Use addr2line to analyze the crash problem

addr2line analysis crash problem

addr2line function

addr2line can locate the file, function, and line where the exception occurred by parsing the address; however, it is only valid for the process or library file with the -g parameter during compilation, so if you want to use addr2line to define the location when the process crashes, you need to compile Compile with the -g parameter.

addr2line uses

1. Print the stack log, search for the keyword "backtrace" in hilogs
2. Extract the corresponding process, generally "libc.so" is the system library, don't pay attention, continue to look down such as wpa_supplinat, find the corresponding process
//some processes have been added Compilation information (the size of the library will be larger), such as android "/symbols/"
3. Extract the error address, focus on the hexadecimal number after "pc"
use addr2line -e "hexadecimal address value" "process name " parse error

Guess you like

Origin blog.csdn.net/htt789/article/details/128891231