User forums > Help
Debugger won't work
verxintRising:
Out of nowhere, my debugger can no longer go line by line. I have "include debugging symbols" in the build options, but whenever I try to run to cursor, it runs through the whole program (or in this case, until it segfaults). I can't fix the aforementioned segfault without going a line at a time.
Thanks.
oBFusCATed:
C::B version, GCC version, GDB version, OS version?
Does gdb work from the console?
verxintRising:
C::B v 8.02 running on windows vista
GCC should be v4.3.3, or whatever the latest is.
GDB v6.7.50.20071127
GDB will still work fine from the console, as far as I can tell.. I don't really understand how to use it.
it does give 3 errors saying a DLL wasn't found at some random address, but it doesn't seem to stop GDB from running.
oBFusCATed:
Please try newer gdb... at least 6.8, but you could try and 7.0.2+ (search the forum for the binary)
Also consult the gdb help/manual how to use gdb from the console.
You can paste the output of the debugger's log, so we can take a look at this. To enable the log: settings -> compiler & debugger -> debugger -> show debugger's debug log (or something like that).
Another thing, does debugging of simple console project work?
verxintRising:
I'm using MinGW, are there any particulars for upgrading gdb I should know?
It seems like some programs will debug properly and other's won't. I can't find any consistency either, one project will go line by line perfectly, and another that's about equally simple won't.
here's the debug log for one of the ones that refuses to stop at the line I specify:
--- Code: ---Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Users\Verx\Documents\C++\Macro Killer (general)\convert a macro with arguments\
Adding source dir: C:\Users\Verx\Documents\C++\Macro Killer (general)\convert a macro with arguments\
Adding file: bin\Debug\convert a macro with arguments.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
Function "C:/Users/Verx/Documents/C++/Macro Killer (general)" not defined.
Breakpoint 1 ("C:/Users/Verx/Documents/C++/Macro Killer (general)/convert a macro with arguments/main.cpp:13) pending.
Child process PID: 1800
Program exited normally.
Debugger finished with status 0
--- End code ---
and here's the log for one that works properly:
--- Code: ---Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Users\Verx\Documents\C++\OneLine\
Adding source dir: C:\Users\Verx\Documents\C++\OneLine\
Adding file: bin\Debug\OneLine.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
Child process PID: 6984
At C:/Users/Verx/Documents/C++/OneLine/main.cpp:11
--- End code ---
this part seems to show up only in the non-working project:
--- Code: ---Function "C:/Users/Verx/Documents/C++/Macro Killer (general)" not defined.
Breakpoint 1 ("C:/Users/Verx/Documents/C++/Macro Killer (general)/convert a macro with arguments/main.cpp:13) pending.
--- End code ---
I went through and removed the parenthesis in the file path, since I figured that might in some strange way be messing it up, and I get this now:
--- Code: ---Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: C:\Users\Verx\Documents\C++\Macro Killer\convert a macro with arguments\
Adding source dir: C:\Users\Verx\Documents\C++\Macro Killer\convert a macro with arguments\
Adding file: bin\Debug\convert a macro with arguments.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
No source file named C:/Users/Verx/Documents/C++/Macro Killer/convert a macro with arguments/main.cpp.
Breakpoint 1 ("C:/Users/Verx/Documents/C++/Macro Killer/convert a macro with arguments/main.cpp:13) pending.
Child process PID: 4828
Program exited normally.
Debugger finished with status 0
--- End code ---
The hell does it mean there isn't a file named main.cpp.. There definitely is.
And I just realized there's a different debug log you guys want.. here's one running through a more complex program that also refuses to debug properly
--- Code: ---PATH=.;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\java\jdk1.6.0_07\bin\
Command-line: C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet -args "bin/Debug/Macro Killer (program).exe"
Working dir : C:\Users\Verx\Documents\C++\Macro Killer\Macro Killer\
> set prompt >>>>>>cb_gdb:
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.7.50.20071127
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32".
>>>>>>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 debugevents on
>>>>>>cb_gdb:
> set new-console on
>>>>>>cb_gdb:
> set disassembly-flavor att
>>>>>>cb_gdb:
> directory C:/Users/Verx/DOCUME~1/C__~1/MACROK~2/MACROK~1/
>>>>>>cb_gdb:
> tbreak "C:/Users/Verx/Documents/C++/Macro Killer/Macro Killer/main.cpp:5"
No source file named C:/Users/Verx/Documents/C++/Macro Killer/Macro Killer/main.cpp.
Breakpoint 1 ("C:/Users/Verx/Documents/C++/Macro Killer/Macro Killer/main.cpp:5) pending.
>>>>>>cb_gdb:
> run
gdb: win32_init_thread_list
Error: dll starting at 0x779b0000 not found.
Error: dll starting at 0x76170000 not found.
Error: dll starting at 0x779b0000 not found.
Error: dll starting at 0x77ae0000 not found.
Program exited normally.
>>>>>>cb_gdb:
> set debugevents off
>>>>>>cb_gdb:
> quit
--- End code ---
Sorry for posting massive blocks of code but I have no idea where this could be coming from.
Navigation
[0] Message Index
[#] Next page
Go to full version