I compiled my library (specifically protbuf-2.3.0 ) using -g -O0 on SunOS 5.10.
An example of a line in the log:
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -pthreads -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -g -O0 -MT text_format.lo -MD -MP -MF .deps/text_format.Tpo -c -o text_format.lo `test -f 'google/protobuf/text_format.cc' || echo './'`google/protobuf/text_format.cc libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -D_REENTRANT -pthreads -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -g -O0 -MT text_format.lo -MD -MP -MF .deps/text_format.Tpo -c google/protobuf/text_format.cc -fPIC -DPIC -o .libs/text_format.o
And then I connected my gdb by following these steps:
- Run my application (in this case, my web server is launching a Java application using the library through jni at startup).
- I linked my gdb to this process via
gdb -p XXX (where XXX is the pid I received from ps ). - And then I downloaded my library from gdb using
file libprotobuf.so from the gdb prompt.
But I can not see the names of my functions from bt . The GDB backtrace command shows something like this:
(gdb) bt #0 0xf8f98914 in ?? () #1 0xf8f98830 in ?? () Backtrace stopped: previous frame identical to this frame (corrupt stack?)
I also tried doing only # 1 and # 2, # 1 and # 3, and # 1 and gdb libprotobuf.so -p XXX .
In addition, I also tried to run my jvm in debug mode and added a breakpoint in the System.loadLibrary(..) command, and after going through this command, I performed the gdb binding process again ... but still nothing.
However, I can set breakpoints for the given function names and list the contents of the function via list . But then again, I can place breakpoints, but they also donβt stop at these function names (I know that he switched to this function because he is in the jvm hs_err_pid report after every jvm failure).
Any ideas come that it doesn't show me the names of my functions?
source share