fine-grained exceptions/signals for break-to-GDB?
Posted: Sat Mar 22, 2014 3:35 pm
Hi Eran,
do you think it's possible to select which C++ exceptions / signals should trigger a break to debugger? right now it's all-or-nothing for all CL instances.
I just waded through tons of GDB and libstdc++ docs but there are so many caveats it seems a nightmare. I saw "GDB catchpoints" with signal regexes/lists but they're apparently gcc 4.8+ dependent, there's "catch catch" and "catch throw", but sometimes the line where the exception is thrown doesn't have symbols, there are "personality" functions and lower-level hacking that taps directly into the C runtime. Do you know of a magic solution?
I'm trying to implement signal handlers via ASIO but I see some are being blocked in CodeLiteApp:OnInit() and anyway ASIO has other drastic requirements like moving a lot of network logic to async handlers (http://think-async.com/Asio/asio-1.5.1/ ... l_set.html). It's admittedly an extreme case; just being able to separate the type of exceptions used by client C++11 code from lower-level errors would a huge step forward. Personally I wouldn't mind using a CL-specific header in debug builds if it'd make it easier to implement.
Easy question for dessert: when the GDB program counter jumps backwards is that because "reverse debugging" kicks in? (http://www.gnu.org/software/gdb/news/reversible.html? I haven't come across it since I learned about
yet.
thx & cheers!
-- p
do you think it's possible to select which C++ exceptions / signals should trigger a break to debugger? right now it's all-or-nothing for all CL instances.
I just waded through tons of GDB and libstdc++ docs but there are so many caveats it seems a nightmare. I saw "GDB catchpoints" with signal regexes/lists but they're apparently gcc 4.8+ dependent, there's "catch catch" and "catch throw", but sometimes the line where the exception is thrown doesn't have symbols, there are "personality" functions and lower-level hacking that taps directly into the C runtime. Do you know of a magic solution?
I'm trying to implement signal handlers via ASIO but I see some are being blocked in CodeLiteApp:OnInit() and anyway ASIO has other drastic requirements like moving a lot of network logic to async handlers (http://think-async.com/Asio/asio-1.5.1/ ... l_set.html). It's admittedly an extreme case; just being able to separate the type of exceptions used by client C++11 code from lower-level errors would a huge step forward. Personally I wouldn't mind using a CL-specific header in debug builds if it'd make it easier to implement.
Easy question for dessert: when the GDB program counter jumps backwards is that because "reverse debugging" kicks in? (http://www.gnu.org/software/gdb/news/reversible.html? I haven't come across it since I learned about
Code: Select all
(gdb) show exec-direction (forward/reverse)
thx & cheers!
-- p