Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Evaluating the output of gdb monitor commands

Norbert,

Correct me if I'm wrong, but the records prefixed by @ represent the output from the program being debugged. Why would gdb print something to this stream?

Thanks,
Mikhail Khodjaiants

----- Original Message ----- From: "Ploett, Norbert" <norbert.ploett@xxxxxxxxxxx>
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Sent: Tuesday, November 29, 2005 9:48 AM
Subject: [cdt-dev] Evaluating the output of gdb monitor commands


Hello all,

now this is nifty ... We want to use gdb's response to a monitor command
(currently "monitor mbox") to fill a newly created debug view which will
report the status of the mailboxes on our (eCos) target. A snippet from
the gdb session would look like this:

=====================================
(gdb) monitor mbox

Box at 0x320dd56c: 0 messages
Box at 0x320dd890: 15 messages
Total 1 boxes

(gdb)
=====================================

Here is the scheme how we thought to do it:

- We register a debug event handler which gets called when the target
suspends (works).
- We create a new CLIMonitorMbox command, derived from CLICommand and
post it to the MISession (works).
- We see the output of the monitor command on the console if we activate
debugging of the org.eclipse.cdt.debug.mi.core plug-in (fine)
- We request the out-of-band records of the corresponding
CLIMonitorMboxInfo which we created. (Works, but ...)
- We analyze the output which is stored in the OOBs and populate the
view. (Does not work - we get only a single record, the command itself
(i.e. "monitor mbox\n") No "Box at ..." records!)

Investigation showed:
- All strings returned by gdb are processed in
org.eclipse.cdt.debug.mi.core.RxThread.processMIOutput(String buffer)
- gdb's responses are all identified as stream records (call
processMIOOBRecord((MIStreamRecord) oob)
- The responses to the monitor command which we would like to analyze
have the @-prefix and are therefore considered to belong to the target
stream. Target stream records are not collected for the command's MIInfo
- this is where our scheme breaks down.
- The command itself on the other hand is identified as
MILogStreamOutput and is therefore collected for the command's MIInfo.
- BTW the third stream, the MIConsoleStreamOutput is also collected for
the command's MIInfo.

So why are target stream records not collected? Some commands may be
putting valuable output into this stream also. Is there a reason why
they should not be collected?

Pooh, this is pretty deep and special. I hope that somebody can respond
to this.

Greetings


Norbert
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top