User forums > Using Code::Blocks
gdb stop on c++ exceptions
Ingrater:
I'm trying to make the gdb debugger to stop on c++ exceptions so I've read the gdb manual. I've found an advice there to set a breakpoint on the ansi c __raise_exception function to catch possible exceptions exactly were they are thrown. Unfortunately I have no clue how to achieve this inside the Code::Blocks IDE. I'm Using Code::Blocks on Windows with MinGW and GDB.
Thanks in advance.
thomas:
Did you try typing "break __raise_exception" into the "send user command to debugger" thingie (last menu item in debug menu)?
Granted, that's about the most inconvenient way of setting a breakpoint, but I don't think there's another way right now.
Yiannis, does the debugger plugin export functions for scripts? If so, that could be a 2-liner script plugin...
Ingrater:
Tried "catch throw" and "break __raise_exception"
Both had absoluty no effect.
mandrav:
You could try adding the command Thomas gave you to "Settings->Compiler and debugger->Debugger->initialization commands".
Though you might have a hard time finding the exact function to break. For example, in my case (linux), I had to add "break __cxa_throw".
thomas:
--- Quote ---"break __cxa_throw"
--- End quote ---
Same here (MinGW-gcc 4.2-DW2), however, unluckily it doesn't work so well.
It does interrupt the program, but you can't do much but continue (or step onward). For some reason, the debugger plugin doesn't wake up and show the current line, nor disassemble or update watches.
Navigation
[0] Message Index
[#] Next page
Go to full version