问题
Tests :
[1] creating divide of 0 in executable hat was compiled with optimization (O2) and debugging symbols , thus a core was generated.
[2] creating divide of 0 in shared object hat was compiled with optimization (O2) and debugging symbols , thus a core was generated.
Results:
[First] analysing the core generated by [1] was succeeded and an exact location of the crush could be seen in GDB/Totalview.
[Second] analysing the core generated by [2] was NOT succeeded and a hex numeric location was the output of the crush.
can someone tell how can i get [2] to succeed ?
回答1:
Check with ldd that your shared object can be found.
If not, try with shell variable LD_LIBRARY_PATH to set its path and try again gdb <executable> core.
Another option is to edit config /etc/ld.so.conf and run ldconfig.
回答2:
Solved it , i was opening the core file like this :
- gdb core core-file-name
- file location-of-binary
then the binary symbols was loaded, BUT Not any shared objects !!!!!
going this way :
- gdb -c core-file-name location-of-binary
this caused binary symbols to be loaded BUT ALSO shared objects symbols to be loaded as well !!!
thanks for the help.
来源:https://stackoverflow.com/questions/3502340/analyzing-core-file-of-shared-object