Okay, I've been battling this problem for a few days. I installed Code::Blocks 12.11 and discovered it segfaulted on breakpoint when debugging. A rudimentary google search linked me here to a thread that indicated the problem was due to GCC optimizing out strings and whatever. Can't find any arguments to pass to GCC to cease this behaviour, so I went with the thread and set out to install Pretty Printers using the
guide on the C::B wiki.
After extracting MinGW-Builds over the CodeBlocks MinGW, it started complaining about the target not being compatible with x86-64 or whatever, so I set it to build with the i686 target. It then compiled, and it ran with the debugger! Yay! But then when I put in breakpoints, the debugger seems to effectively crash on the breakpoint. It comes with this output:
[debug]Command-line: C:\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/Users/Hayley/Documents/CodeBlocks/StringTest/bin/Debug/StringTest.exe
[debug]Working dir : C:\Users\Hayley\Documents\CodeBlocks\StringTest
Starting debugger: C:\MINGW\bin\gdb.exe -nx -fullname -quiet -args C:/Users/Hayley/Documents/CodeBlocks/StringTest/bin/Debug/StringTest.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from C:\Users\Hayley\Documents\CodeBlocks\StringTest\bin\Debug\StringTest.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5.1
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later
[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 "x86_64-w64-mingw32".
[debug]For bug reporting instructions, please see:
[debug].
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.5.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]> directory C:/Users/Hayley/Documents/CodeBlocks/StringTest/
[debug]Source directories searched: C:/Users/Hayley/Documents/CodeBlocks/StringTest;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Hayley/Documents/CodeBlocks/StringTest/main.cpp:20"
[debug]Breakpoint 1 at 0x40139b: file C:\Users\Hayley\Documents\CodeBlocks\StringTest\main.cpp, line 20.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:\Users\Hayley\Documents\CodeBlocks\StringTest\bin\Debug\StringTest.exe
Child process PID: 10720
[debug][New Thread 10720.0x2818]
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Do you need "set solib-search-path" or "set sysroot"?
[debug]Program received signal ?, Unknown signal.
[debug]0x0008de08 in ?? ()
[debug]>>>>>>cb_gdb:
What's going on?