Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 78382

Summary: CDT swallows output from GDB "monitor" command
Product: [Tools] CDT Reporter: Oyvind Harboe <oyvind.harboe>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: will_lentz
Version: 2.1   
Target Milestone: Future   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
Stopgap hack none

Description Oyvind Harboe CLA 2004-11-11 07:47:46 EST
The "monitor" is forward to the GDB server, in my case a JTAG debugger which 
also has support for flash programming.

Also, the string that comes after "monitor" must be passed on unmolested. Note 
that the path below in the monitor command is not necessarily in the Eclipse 
host OS or GDB host OS format. Eclipse should make no assumptions, just pass on 
the string(in the example below, the \ causes problems...


--- CDT GDB console output ----
monitor erase 0x1030000 0x10000 21
monitor prog 0x1030000 c:\cdtworkspace\firmware\output\rimi.bin bin
monitor prog 0x1030000 c:\cdtworkspaceirmware\output
imi.bin bin
monitor prog 0x1030000 c:\\cdtworkspace\\firmware\\output\\rimi.bin bin
monitor prog 0x1030000 c:\cdtworkspace\firmware\output\rimi.bin bin
------
Comment 1 Oyvind Harboe CLA 2004-11-11 07:57:24 EST
Showing output from GDB & monitor command:

$ ./gcc/build/gnutools/bin/arm-elf-gdb.exe --interpreter=mi
~"GNU gdb 6.2.1\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you 
are\n"
~"welcome to change it and/or distribute copies of it under certain 
conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB.  Type \"show warranty\" for 
details.\n"
~"This GDB was configured as \"--host=i686-pc-cygwin --target=arm-elf\"."
~"\n"
(gdb)
target remote 192.168.222.201:2001
&"target remote 192.168.222.201:2001\n"
^done,thread-id="0",frame={addr="0x010000d4",func="??",args=[]}
(gdb)
monitor erase 0x1030000 0x10000 5
&"monitor erase 0x1030000 0x10000 5\n"
@"Erasing flash at 0x01030000"
@"\r\n"
@"Erasing flash at 0x01040000"
@"\r\n"
@"Erasing flash at 0x01050000"
@"\r\n"
@"Erasing flash at 0x01060000"
@"\r\n"
@"Erasing flash at 0x01070000"
@"\r\n"
@"Erasing flash passed"
@"\r\n"
^done
(gdb)
Comment 2 Alain Magloire CLA 2004-11-22 16:26:18 EST
for the future
Comment 3 Oyvind Harboe CLA 2004-11-22 17:16:29 EST
This problem also exists for the commands executed by the idleLaunch debug
commands. Ideally the output should show *while* the command is being executed.

Øyvind
Comment 4 Marco Langejans CLA 2004-11-29 05:59:30 EST
A similar problem occurs when sending the GDB "load" command. The result is that
there is no feedback (GDB console window) indicating that loading is finished.

MHL
Comment 5 Oyvind Harboe CLA 2004-12-02 07:09:51 EST
Created attachment 16290 [details]
Stopgap hack

This is a stopgap hack that will output the output from the "monitor" command
to the GDB console for the Zylin embedded CDT plugin.

Obviously someone with more CDT/GDB acumen will be frown upon this :-)

Alain gave me enough clues to figure out the hack.

Øyvind
Comment 6 Oyvind Harboe CLA 2004-12-02 07:25:50 EST
>Ha! yes.
>The '@' stream is consider to be the "target-stream-output" in MI parlance
>This output is not shown to the user .. if we push it to the console with
>this be satisfactory ?

The GDB console, yes.

Note that my hack added an extranous newline to each line output to the GDB console.

Øyvind
Comment 7 Oyvind Harboe CLA 2006-05-10 04:07:36 EDT
The new Verbose mode sufficiently addresses this problem. Perhaps not the most elegant solution, but I'm sure palatable patches are accepted with thanks should someone wish to spend time on this :-)