Gdb gives no stack on a simple std::string uncaught exception
im a little bit newbie on gdb so here goes:
Im working on cpp unit testing operation right now. I try to construct string objects with invalid parameters like null_char but program expectedly gives exceptions :). When i try to debug the app using gdb, i type bt开发者_StackOverflow after the crash, but it gives me no stack message. Any ideas to why that might happen? Thanks in advance.
Maybe the stack is just not useful because the exception is never caught? Be aware of catchpoints in gdb:
catch throw
breaks when an exception is thrown.
catch catch
breaks when an exception is caught.
Add the -g
option to your compiler command line to add debugging symbols. That helps a lot with gdb
.
精彩评论