How do I create Libgdx.so from an Android source with gdb trace enabled?

I installed a debug ROM on my Android device and turned on my own bunch of DDMS in search of a libgdx memory leak.

Now I have a trace but no source code to follow it.

I downloaded the libgdx source code.

How can I create it by allowing gdb tracing so that I can keep track of the code referenced by the tracing?

Update:

I built debug.so libgdx from the source. To do this, I changed the file: libgdx / GDX / JNI / extension android32.xml

Adding natives to the target I also added APP_OPTIM: = debug for Application.mk in the same folder And added '-g' to the Android.mk file in the same folder: LOCAL_CFLAGS: = -g $ (LOCAL_C_INCLUDES:% = - I %) -O2 -Wall -D__ANDROID__

This really creates the dbg dynamic library libgdx.so in libgdx / gdx / linest / armeabi

Although I am getting closer, I still cannot get the name of the function that loads the memory.

I use arm-linux-androideabi-addr2line and Hex function address, but it prints ??

+4
source share
1 answer

Download the Android source code and create it.

Specify DDMS in libraries with debugging symbols. At the command line:

export ANDROID_SYMBOLS = $ ANDROID_SOURCE / out / target / product / flo / symbols / system / lib

Note that $ ANDROID_SOURCE refers to the location where you created the Android source.

run DDMS from this shell

$ DDMS

Now you should see your own tracks on ddms.

libgdx $LIBGDX_SOURCE/libgdx/gdx/obj/local/armeabi/libgdx.so $ANDROID_SOURCE/out/target/product/flo/symbols/system/lib, libgdx.so.

adb root
adb shell setprop libc.debug.malloc 1
adb shell stop
adb shell start

ROM dbg.

+2

All Articles