Author Topic: debugger_gdbmi pretty printing  (Read 11609 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: debugger_gdbmi pretty printing
« Reply #15 on: April 06, 2012, 10:46:51 pm »
The patch produced the same results as before. I have to click the little '+' sign to see the string.


Code
Active debugger config: GDB/MI:Default
start debugger
Building to ensure sources are up-to-date
Selecting target:
debug
Adding file: C:\Usr\Proj\test\Testpp\debug\Testpp.exe

[debug]PATH=.;C:\Usr\Proj\wxWidgets2810\lib\gcc_lib;C:\Usr\mingw431\bin;C:\Usr\mingw431;C:\Usr\Proj\ImageCraft\ImageCraft_IDB\trunk\src\output;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Dell\Dell Wireless WLAN Card;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;C:\Usr\bin;C:\Program Files (x86)\CollabNet Subversion;C:\Program Files (x86)\TortoiseSVN\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Common Files\Adobe\AGL;c:\Usr\mingw431\bin

GDB path: c:\Usr\mingw463\bin\gdb.exe
DEBUGGEE path: C:\Usr\Proj\test\Testpp\debug\Testpp.exe
Command-line: c:\Usr\mingw463\bin\gdb.exe -fullname  -quiet --interpreter=mi -args C:\Usr\Proj\test\Testpp\debug\Testpp.exe
Working dir : C:\Usr\Proj\test\Testpp\.
Starting debugger:

[debug]Executing command: c:\Usr\mingw463\bin\gdb.exe -fullname  -quiet --interpreter=mi -args C:\Usr\Proj\test\Testpp\debug\Testpp.exe

done

[debug]Executor stopped
[debug]Debugger_GDB_MI::CommitBreakpoints
[debug]ActionsMap::Run -> starting action: 05D5D430 id: 1
[debug]BreakpointAddAction::m_initial_cmd = 10000000000
[debug]cmd==>10000000000-break-insert C:\Usr\Proj\test\Testpp\TestppMain.cpp:96
[debug]ActionsMap::Run -> starting action: 05D6B7F0 id: 2
[debug]cmd==>20000000000-interpreter-exec console "source c:\\Usr\\mingw431\\bin\\stl.gdb"
[debug]ActionsMap::Run -> starting action: 05D6B8C8 id: 3
[debug]cmd==>30000000000-interpreter-exec console "source c:\\Usr\\mingw431\\bin\\wx.gdb"
[debug]ActionsMap::Run -> starting action: 05D6B3B8 id: 4
[debug]cmd==>40000000000-enable-pretty-printing
[debug]output==>=thread-group-added,id="i1"
[debug]unparsable_output==>~"Reading symbols from C:\\Usr\\Proj\\test\\Testpp\\debug\\Testpp.exe..."
[debug]notification event recieved!
[debug]unparsable_output==>~"done.\n"
[debug]unparsable_output==>(gdb)
[debug]output==>10000000000^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00402f69",func="TestppDialog::OnAbout(wxCommandEvent&)",file="C:\\Usr\\Proj\\test\\Testpp\\TestppMain.cpp",fullname="C:\\Usr\\Proj\\test\\Testpp\\TestppMain.cpp",line="96",times="0",original-location="C:\\Usr\\Proj\\test\\Testpp\\TestppMain.cpp:96"}
[debug]unparsable_output==>(gdb)
[debug]unparsable_output==>&"c:\\Usr\\mingw431\\bin\\stl.gdb:6: Error in sourced command file:\n"
[debug]unparsable_output==>&"Python scripting is not supported in this copy of GDB.\n"
[debug]output==>20000000000^error,msg="c:\\Usr\\mingw431\\bin\\stl.gdb:6: Error in sourced command file:\nPython scripting is not supported in this copy of GDB."
[debug]unparsable_output==>(gdb)
[debug]unparsable_output==>&"c:\\Usr\\mingw431\\bin\\wx.gdb:6: Error in sourced command file:\n"
[debug]unparsable_output==>&"Python scripting is not supported in this copy of GDB.\n"
[debug]output==>30000000000^error,msg="c:\\Usr\\mingw431\\bin\\wx.gdb:6: Error in sourced command file:\nPython scripting is not supported in this copy of GDB."
[debug]unparsable_output==>(gdb)
[debug]output==>40000000000^done
[debug]BreakpointAddAction::OnCommandResult: 10000000000
[debug]BreakpointAddAction::breakpoint index is 1
[debug]BreakpointAddAction::Finishing1
[debug]BreakpointAddAction::destructor
[debug]ActionsMap::Run -> starting action: 05CC2740 id: 5
[debug]RunAction::OnStart -> -exec-run
[debug]cmd==>50000000000-exec-run
[debug]unparsable_output==>(gdb)
[debug]output==>=thread-group-started,id="i1",pid="4156"
[debug]output==>=thread-created,id="1",group-id="i1"
[debug]unparsable_output==>~"[New Thread 4156.0x9cc]\n"
[debug]output==>50000000000^running
[debug]notification event recieved!

Found child pid: 4156


[debug]notification event recieved!
[debug]RunAction success, the debugger is !stopped!
[debug]RunAction::Output - type: result
class: running
results:

[debug]Executor started
[debug]output==>*running,thread-id="all"
[debug]RunAction::destructor
[debug]unparsable_output==>(gdb)
[debug]notification event recieved!
[debug]unparsable_output==>&"warning: Can not parse XML library list; XML support was disabled at compile time\n"
[debug]output==>=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00402f69",func="TestppDialog::OnAbout(wxCommandEvent&)",file="C:\\\\Usr\\\\Proj\\\\test\\\\Testpp\\\\TestppMain.cpp",fullname="C:\\\\Usr\\\\Proj\\\\test\\\\Testpp\\\\TestppMain.cpp",line="96",times="1",original-location="C:\\\\Usr\\\\Proj\\\\test\\\\Testpp\\\\TestppMain.cpp:96"}
[debug]output==>*stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x00402f69",func="TestppDialog::OnAbout",args=[{name="this",value="0x21c5ca8"},{name="event",value="..."}],file="C:\\Usr\\Proj\\test\\Testpp\\TestppMain.cpp",fullname="C:\\Usr\\Proj\\test\\Testpp\\TestppMain.cpp",line="96"},thread-id="1",stopped-threads="all"
[debug]unparsable_output==>(gdb)
[debug]notification event recieved!
[debug]notification event recieved!
[debug]Executor stopped
[debug]ActionsMap::Run -> starting action: 05CCFD80 id: 6
[debug]cmd==>60000000000-var-create - @ msg
[debug]output==>60000000000^done,name="var1",numchild="1",value="{...}",type="wxString",thread-id="1",has_more="0"
[debug]unparsable_output==>(gdb)
[debug]WatchCreateAction::OnCommandOutput - processing command 60000000000
[debug]WatchCreateAction::Output - finishing at60000000000
[debug]updating watches
[debug]ActionsMap::Run -> starting action: 05D6B958 id: 7
[debug]cmd==>70000000000-var-delete var1
[debug]output==>70000000000^done,ndeleted="1"
[debug]unparsable_output==>(gdb)



Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: debugger_gdbmi pretty printing
« Reply #16 on: April 06, 2012, 10:56:03 pm »
Code
[debug]cmd==>20000000000-interpreter-exec console "source c:\\Usr\\mingw431\\bin\\stl.gdb"
[debug]cmd==>30000000000-interpreter-exec console "source c:\\Usr\\mingw431\\bin\\wx.gdb"
[debug]cmd==>40000000000-enable-pretty-printing
[debug]output==>20000000000^error,msg="c:\\Usr\\mingw431\\bin\\stl.gdb:6: Error in sourced command file:\nPython scripting is not supported in this copy of GDB."
[debug]output==>30000000000^error,msg="c:\\Usr\\mingw431\\bin\\wx.gdb:6: Error in sourced command file:\nPython scripting is not supported in this copy of GDB."
I guess this is the reason - the source commands for loading the pretty printers are executed before the enable command for pretty printing.
I'll move it before them. In the mean time you can try to put '-enable-pretty-printing' before the two source commands in the initial commands.

Edit: I've committed both changes.
« Last Edit: April 06, 2012, 11:01:23 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: debugger_gdbmi pretty printing
« Reply #17 on: April 07, 2012, 12:46:51 am »
Using the debugger branch (not gdbmi) and carefully specifying the gdb directory, I get the following with pretty printing. It looks very much like the output of the gdbmi plugin (except without so many '+'s .



Looks ok to me. What are we supposed to be looking for?
Now I'll do the same with gdbmi.

Edit: Here's the gdbmi output (also the debugger branch)


I don't see a problem. But I don't know what I'm supposed to see either.
« Last Edit: April 07, 2012, 12:53:54 am by Pecan »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2750
Re: debugger_gdbmi pretty printing
« Reply #18 on: April 07, 2012, 01:16:43 am »
Both default debugging and gdbmi debugging report that no python scripting is supported in this gdb (7.4 windows)

Code
debug]> source C:\Usr\MinGW431\bin\stl.gdb
source C:\Usr\MinGW431\bin\wx.gdb
[debug]C:\Usr\MinGW431\bin\stl.gdb:6: Error in sourced command file:
[debug]Python scripting is not supported in this copy of GDB.
[debug]C:\Usr\MinGW431\bin\wx.gdb:6: Error in sourced command file:
[debug]Python scripting is not supported in this copy of GDB.
[debug]>>>>>>cb_gdb:>>>>>>cb_gdb:

So... looks like pretty printing is not supported in windows gdb 7.4
At least it's not supported in any gdb I could find.

This is the only gdb 7.4 that I could find for windows.
Code
[debug]Reading symbols from C:/Usr/Proj/test/Testpp/debug/Testpp.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.4
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-pc-mingw32".
« Last Edit: April 07, 2012, 01:18:52 am by Pecan »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: debugger_gdbmi pretty printing
« Reply #19 on: April 07, 2012, 07:47:58 am »
@pecan: For gdb 7.4
Either python enabled gdb(gdb-python27.exe) and traditional gdb(gdb.exe) can be found in:
http://sourceforge.net/projects/mingw/files/MinGW/Extension/gdb/GDB-7.4/

BTW: I have gdb CVS build(newer than gdb 7.4)
You can also try my personal build gdb, which is python enabled.
http://forums.codeblocks.org/index.php/topic,11301.msg77000.html#msg77000
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: debugger_gdbmi pretty printing
« Reply #20 on: April 07, 2012, 09:08:12 am »
Pecan:
What you should expect is to see something like this  '|msg |"msg value"|wxString|' in the watches or in the value tooltips.
If you see the guts of the object, then pretty printers doesn't work.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline p2rkw

  • Almost regular
  • **
  • Posts: 142
Re: debugger_gdbmi pretty printing
« Reply #21 on: April 07, 2012, 02:07:43 pm »
@Pecan: make sure that you selected correct debugger settings at: Settings->Compiler->Toolchain executables->Debugger.
And use gdb-python27.exe (its also included in tdm gcc) instead of gdb.exe.