简体   繁体   中英

gdb corefile not see function parameters

My application crashed due to uncaught exception (my c++ code throws uncaught exception under certain condition). I am trying to gdb the corefile. The binary library is "not striped". And the stack trace shows the function (my code) from which an uncaught exception is thrown, but when I try to print the function arguments, I always get "no symbol xxx in current context". info args also return "No symbol table info available".

Can anyone shed a light why ? is it due to the uncaught exception which unwind/corrupts the stack ?

Thanks, Frank

Your binary lacks debug info.

If you built it with gcc , and want to debug the core you already have (if eg it's hard to reproduce the crash), you may be able to recover from this by rebuilding the binary with exactly the same source and command lines, adding -g to compile and link commands. (Note: you must use the same compile lines; replacing -O2 with -g wouldn't do.)

If the crash is not hard to reproduce, simply rebuild the binary with -g -O0 , run it under GDB, and enjoy "easy" debugging.

The binary library is "not striped".

This doesn't mean what you think it means. Not stripped means that the symbol table is still present in the binary.

GDB will read this symbol table, and use it to map ranges of addresses to function names.

But to recover names and values of local variables and parameters, you must compile with debug info (which is what -g flag does for most compilers).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM