User forums > Help
Gdb shows nothing
Krice:
I've build my project with -g and without -s obviously, on Windows 10 / SDL2 project. When I run the program with F8 it does exit on crash, but the debugger tells nothing about it, other than exit code 03. Am I missing something here? In this case I know why and where the crash happens, but shouldn't the debugger know it, too?
oBFusCATed:
Most probably some dll is not found. GDB is not very good for telling you about these problems.
A better guess could be made if you provide the full debug log (it should be enabled in the settings of the debugger; make sure to use code or quote tags when pasting logs).
Krice:
--- Code: ---[debug]Command-line: C:\TDM-GCC-32\bin\gdb32.exe -nx -fullname -quiet -args C:/projects/Teemu/Teemu.exe
[debug]Working dir : C:\projects\Teemu
Starting debugger: C:\TDM-GCC-32\bin\gdb32.exe -nx -fullname -quiet -args C:/projects/Teemu/Teemu.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]Reading symbols from C:/projects/Teemu/Teemu.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 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 "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.9.1
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\Program Files (x86)\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/projects/Teemu/
[debug]Source directories searched: C:/projects/Teemu;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\projects\Teemu\Teemu.exe
Child process PID: 6644
[debug][New Thread 6644.0x440]
[debug][New Thread 6644.0x2484]
[debug][New Thread 6644.0x1264]
[debug][New Thread 6644.0x1508]
[debug][New Thread 6644.0x1ba0]
[debug][Thread 6644.0x1ba0 exited with code 0]
[debug][New Thread 6644.0x15c8]
[debug][Thread 6644.0x1508 exited with code 3]
[debug][Thread 6644.0x1264 exited with code 3]
[debug][Thread 6644.0x2484 exited with code 3]
[debug][Thread 6644.0x15c8 exited with code 3]
[debug][Inferior 1 (process 6644) exited with code 03]
[debug]>>>>>>cb_gdb:
[Inferior 1 (process 6644) exited with code 03]
[debug]> quit
Debugger finished with status 0
--- End code ---
oBFusCATed:
You can try to put a breakpoint on exit and see what happens.
But I'm not 100% sure that this is the function that is called for all cases when on wants to exit a thread.
To set a breakpoint you need to add "break exit" in the initial commands in the debugger settings.
Krice:
--- Quote from: oBFusCATed on September 09, 2017, 03:42:43 pm ---To set a breakpoint you need to add "break exit" in the initial commands in the debugger settings.
--- End quote ---
I don't even know what that means. Isn't the idea when a program crashes the debugger can show where it crashed? I'm not proud of this, but I re-installed Visual Studio and debugged exactly the same project. Boom. It found the place where it crashes. I'm just baffled about gdb, what it is actually doing when it doesn't notice the crash. It just exits as if nothing happened.
Navigation
[0] Message Index
[#] Next page
Go to full version