[ros-bugs] [Bug 6802] New: Submit Debug Com Monitor

ReactOS.Bugzilla at reactos.org ReactOS.Bugzilla at reactos.org
Fri Jan 6 17:16:08 UTC 2012


http://www.reactos.org/bugzilla/show_bug.cgi?id=6802

           Summary: Submit Debug Com Monitor
           Product: ReactOS
           Version: TRUNK
          Platform: x86 Hardware
        OS/Version: ReactOS
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: Tools
        AssignedTo: ros-bugs at reactos.org
        ReportedBy: love.nystrom at gmail.com
         QAContact: ros-bugs at reactos.org


Created an attachment (id=7224)
 --> (http://www.reactos.org/bugzilla/attachment.cgi?id=7224)
Source code and project/build files

ComMon is a simple COM port monitor utility to capture ReactOS debug strings.
It is meant to be used with com0com or a null modem cable on your WS.

Usage:

ComMon requires no installation, just put it somewhere and run it.
You use it with a null modem cable, or e.g. a com0com virtual COM port.
Select your COM port from the combo list (or type in a port name
if your port wasn't enumerated for some reason), then hit 'Start'.

In addition to the UI list, each run it dumped to "ComMon_Log.txt",
which is overwritten every time you hit 'Start'. However, if the
working directory is not writable, no dump file is created.

Baudrate is currently hardcoded at 115200, with 8 data, 1 stop,
no parity, and the parameters can be changed by re-building.

Because log messages are received in chunks (for low overhead),
there can be a delay for short text lines before they're shown
in the message list. If you're not seeing your backtrace,
provoke some more log messages to squeeze it out.

The message list allows multiple/non-contigous selection.
Right-click on the list to open the (self explanatory) context menu..

  Clear List      - Clear the whole list.
  Clear Selection - Remove all selected messages.
  Save List       - Save all messages to a file.
  Copy Selection  - Copy selected messages to clipboard.
  Text Preference - Choose font and color for the list.
  (Your prefs are saved under HKCU\Software\ReactOS\ComMonitor\)

Technical:

COM ports are enumerated by registry HKLM\HARDWARE\DEVICEMAP\SERIALCOMM\.
Port arrival/removal notifications are caught, and the port list updated.

Messages are captured by a receiver thread, in blocks, and text lines
re-assembled by scanning forward for the newline character, waiting for
complete lines before outputting them. The block size is MAX_PATH.
Twiddling the block size may lessen display delays for short lines,
at the expense of increased overhead in the receiver thread.

A Windows bug in treatment of OVERLAPPED::Offset for COM ports
complicates the task of re-assembling the debug message lines.
Refer to "THREADPROC ComMonitor" in ComMon.cpp for details of this.

An IO completion port is used to facilitate an interruptable wait
in the COM thread. The thread uses GetQueuedCompletionStatus to wait
on pending serial input, making it possible to use PostQueuedCompletionStatus
to interrupt a waiting COM thread and stop capture gracefully.
This is the only documented way to implement a serial communications thread
with interruptable overlapped IO operation.

I currently build ComMon with VC6 and gcc (i.e RosBE).
I see no reason it should not build with any MSVS or MinGW as well.
Project files for MSVC6 and Code::Blocks, plus rbuild files, are included.

There is a small issue with gcc in that it doesn't support SEH, which
I use in "operator delete". For now, it's been hacked with a "try/catch"
in lieu of the proper SEH "_try/_except".

Any questions.. contact me by email or ask at the ros-dev list.
Best Regards
// Love


-- 
Configure bugmail: http://www.reactos.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the Ros-bugs mailing list