User forums > Using Code::Blocks
Problem with debugger
kramed:
Im sorry I dont understand clearly. The two routine code above, pasted into codeblocks does not compile on its own therefore no way for me to get debugging output.
I am in #codeblocks on irc.freenode.net if that would make things easier.
Pecan:
--- Quote from: kramed on March 09, 2007, 02:29:03 am ---Im sorry I dont understand clearly. The two routine code above, pasted into codeblocks does not compile on its own therefore no way for me to get debugging output.
I am in #codeblocks on irc.freenode.net if that would make things easier.
--- End quote ---
There are two routines at the bottom of debuggergdb.cpp just like the ones I pasted above named DebuggerGDB::RunNixConsole() and DebuggerGDB::GetConsoleTty .
Please replace those routines with with the two I include above. Compile, quite CB, restart CB, and run the test program.
Paste the "Debugger(debug)" output here.
kramed:
--- Code: ---Command-line: /usr/bin/gdb -nx -fullname -quiet -args bin/Debug/cb_test
Working dir : /home/mark/cb_test/
> set prompt >>>>>>cb_gdb:
Executing: xterm -T 'Program Console' -e sleep
Using host libthread_db library "/lib/tls/libthread_db.so.1".
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-slackware-linux".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> directory /home/mark/cb_test/
>>>>>>cb_gdb:
> delete breakpoints
>>>>>>cb_gdb:
> break "/home/mark/cb_test/pecans.cpp:25"
Breakpoint 1 at 0x8048b31: file /home/mark/cb_test/pecans.cpp, line 25.
>>>>>>cb_gdb:
> break "/home/mark/test/test.cpp:18"
No source file named /home/mark/test/test.cpp.
Breakpoint 2 ("/home/mark/test/test.cpp:18) pending.
>>>>>>cb_gdb:
Executing: ps x -o tty,pid,command
PS result: ? 27347 gaim
PS result: ? 27298 ps x -o tty,pid,command
PS result: ? 27282 /usr/bin/gdb -nx -fullname -quiet -args bin/Debug/cb_test
PS result: ? 24807 codeblocks
PS result: ? 15990 xchat
PS result: ? 13294 kio_file [kdeinit] file /tmp/ksocket-mark/klauncherMOSOQb.slave-socket /tmp/ksocket-mark/ark8vCrBa.slave-socket
PS result: ? 12097 kio_uiserver [kdeinit]
PS result: pts/1 7619 -bash
PS result: ? 7606 konsole [kdeinit] --ls
PS result: ? 3678 /usr/local/apps/firefox/firefox-bin
PS result: ? 3672 /bin/sh /usr/local/apps/firefox/run-mozilla.sh /usr/local/apps/firefox/firefox-bin
PS result: ? 3669 /bin/sh /usr/local/apps/firefox/firefox
PS result: ? 1694 konqueror [kdeinit] -session 108f363330000117332767600000070480034_1173327676_271749
PS result: ? 1645 superkaramba -session 108f363330000117290000300000036900011_1173329213_704079
PS result: ? 1642 superkaramba -session 108f363330000117285908400000027280029_1173329213_704201
PS result: ? 1638 kaccess [kdeinit]
PS result: ? 1630 kicker [kdeinit]
PS result: ? 1627 kdesktop [kdeinit]
PS result: ? 1623 kwin [kdeinit] -session 108f363330000117208531500000062480000_1173329221_738408
PS result: ? 1621 ksmserver [kdeinit]
PS result: tty1 1619 kwrapper ksmserver
PS result: ? 1606 kded [kdeinit] --new-startup
PS result: ? 1604 klauncher [kdeinit] --new-startup
PS result: ? 1600 dcopserver [kdeinit] --nosid
PS result: ? 1597 kdeinit Running...
PS result: tty1 1569 /bin/sh /opt/kde/bin/startkde
PS result: tty1 1567 /bin/sh /usr/X11R6/lib/X11/xinit/xinitrc
PS result: tty1 1556 /usr/X11R6/bin/xinit /usr/X11R6/lib/X11/xinit/xinitrc -- -auth /home/mark/.serverauth.1540
PS result: tty1 1540 /bin/sh /usr/X11R6/bin/startx
PS result: tty1 1514 -bash
PS result: ? 987 java -Xms16m -Xmx128m -cp /usr/local/apps/azureus/Azureus2.jar:/usr/local/apps/azureus/swt.jar -Djava.library.path=/usr/local/apps/azureus -Dazureus.install.path=/usr/local/apps/azureus org.gudy.azureus2.ui.swt.Main /tmp/The.Departed.DVDRip.XviD-PUKKA.torrent
PS result: ? 961 /bin/bash /usr/local/apps/azureus/azureus /tmp/The.Departed.DVDRip.XviD-PUKKA.torrent
PS result: TT PID COMMAND
Console Execution error:failed to find console tty.
> start
Breakpoint 3 at 0x8048a44: file /home/mark/cb_test/pecans.cpp, line 13.
main () at /home/mark/cb_test/pecans.cpp:13
/home/mark/cb_test/pecans.cpp:13:142:beg:0x8048a44
>>>>>>cb_gdb:
> info program
Using the running image of child process 27299.
Program stopped at 0x8048a44.
It stopped at a breakpoint that has since been deleted.
Type "info stack" or "info registers" for more information.
>>>>>>cb_gdb:
> cont
Please type in a String (max. 80 characters):
--- End code ---
Pecan:
Wasn't compiled, or the code was not pasted correctly.
These statements did not execute:
--- Code: ---wxString sleepPid; sleepPid << 80000 + ::wxGetProcessId();
DebugLog(wxString::Format(wxT("RunNixConsole.SleepPid_1 is[%s]"),sleepPid.c_str() ));
sleepPid = wxString::Format(wxT("%d"),80000+ ::wxGetProcessId());
DebugLog(wxString::Format(wxT("RunNixConsole.SleepPid_2 is[%s]"),sleepPid.c_str() ));
--- End code ---
There's no way around them. Please check that they're there and you restarted CB when you ran the test.
Pecan:
I need to know what's wrong with the sleep argument.
The results of the new debugging statements are missing in your posted output.
Output will look like the following:
--- Code: ---Command-line: /usr/bin/gdb -nx -fullname -quiet -args ./conio
Working dir : /home/pecan/proj/conio/
> set prompt >>>>>>cb_gdb:
RunNixConsole.SleepPid_1 is[82576]
RunNixConsole.SleepPid_2 is[82576]
Executing: xterm -font -*-*-*-*-*-*-20-*-*-*-*-*-*-* -T 'Program Console' -e sleep 82576
Using host libthread_db library "/lib/libthread_db.so.1".
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version