How do I build Libgdx.so from source for Android with gdb tracing enabled?

jeremyvillalobos

I have setup a debug ROM on an Android device, and enabled the DDMS Native Heap in search for a libgdx memory leak.

I now have a trace, but no source code attached to follow the lead.

I downloaded libgdx source code.

How do I build it enabling gdb tracing so I can follow the code referenced by the trace ?

Update:

I built the debug .so libgdx from source To do this, I modified the file: libgdx/gdx/jni/build-android32.xml

Adding to the compile-natives target I also added APP_OPTIM := debug to the 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, indeed, produces a dbg libgdx.so dynamic library place in libgdx/gdx/libs/armeabi

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

I am using arm-linux-androideabi-addr2line and the Hex address of the function, but it prints ??

jeremyvillalobos

Download the Android Source and build it.

Point DDMS to the libs with debug symbols. On 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 built the Android source.

start DDMS from that shell

$ddms

Now you should see the native traces on ddms.

I also built libgdx from source and added $LIBGDX_SOURCE/libgdx/gdx/obj/local/armeabi/libgdx.so to $ANDROID_SOURCE/out/target/product/flo/symbols/system/lib to see the method names for libgdx.so.

Preliminaries

You need to set the device to debug memory

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

The device must be rooted or with a dbg ROM.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How do I build Libgdx.so from source for Android with gdb tracing enabled?

From Dev

How do I build libcurl from source?

From Dev

How do I build Unity from source?

From Dev

How do I build libcurl from source?

From Dev

How to build the GDB documentation from source?

From Dev

How do I link assets from android to desktop in libgdx?

From Dev

How can I prevent statements from being output multiple times when SQL tracing is enabled with DBI?

From Dev

How do I build Nautilus 3.70/3.80 from source?

From Dev

How do I build and install a Puppet module locally from source?

From Dev

How do I build Nautilus 3.70/3.80 from source?

From Dev

How do I enable WebAPI response tracing?

From Dev

How do I tell if location detection is enabled in Android

From Dev

How do I tell if location detection is enabled in Android

From Dev

How do I fetch Cake Build prerelease addin from alternative source?

From Dev

How do I build Tmux from source without root access with a custom-built libevent 2.1?

From Dev

How do I use the output of a program from an earlier part of a Stack/Cabal build as source in a later part of the same build?

From Dev

How do I run IIS Express from the command line with "Enabled 32 bit applications" enabled?

From Dev

How do I switch from lldb to gdb debugger types?

From Dev

How do i change the picture/emblem of my android game ? - libGDX

From Dev

<LibGDX> How do I load multiple textures from the same file?

From Dev

LibGDX how do I get a depthbuffer from FrameBuffer?

From Dev

How do I compile from source on github?

From Dev

How do I install the build dependencies for Android?

From Dev

How do I build Boost from github?

From Dev

How do I build Boost from github?

From Dev

How can I build KDE Dolphin from its source code?

From Dev

How do I enable Jaeger JDBC tracing in Quarkus

From Dev

Android studio how to build a project from github source

From Dev

Gradle: how do I include a local jar from a dependent java project in an Android build?

Related Related

  1. 1

    How do I build Libgdx.so from source for Android with gdb tracing enabled?

  2. 2

    How do I build libcurl from source?

  3. 3

    How do I build Unity from source?

  4. 4

    How do I build libcurl from source?

  5. 5

    How to build the GDB documentation from source?

  6. 6

    How do I link assets from android to desktop in libgdx?

  7. 7

    How can I prevent statements from being output multiple times when SQL tracing is enabled with DBI?

  8. 8

    How do I build Nautilus 3.70/3.80 from source?

  9. 9

    How do I build and install a Puppet module locally from source?

  10. 10

    How do I build Nautilus 3.70/3.80 from source?

  11. 11

    How do I enable WebAPI response tracing?

  12. 12

    How do I tell if location detection is enabled in Android

  13. 13

    How do I tell if location detection is enabled in Android

  14. 14

    How do I fetch Cake Build prerelease addin from alternative source?

  15. 15

    How do I build Tmux from source without root access with a custom-built libevent 2.1?

  16. 16

    How do I use the output of a program from an earlier part of a Stack/Cabal build as source in a later part of the same build?

  17. 17

    How do I run IIS Express from the command line with "Enabled 32 bit applications" enabled?

  18. 18

    How do I switch from lldb to gdb debugger types?

  19. 19

    How do i change the picture/emblem of my android game ? - libGDX

  20. 20

    <LibGDX> How do I load multiple textures from the same file?

  21. 21

    LibGDX how do I get a depthbuffer from FrameBuffer?

  22. 22

    How do I compile from source on github?

  23. 23

    How do I install the build dependencies for Android?

  24. 24

    How do I build Boost from github?

  25. 25

    How do I build Boost from github?

  26. 26

    How can I build KDE Dolphin from its source code?

  27. 27

    How do I enable Jaeger JDBC tracing in Quarkus

  28. 28

    Android studio how to build a project from github source

  29. 29

    Gradle: how do I include a local jar from a dependent java project in an Android build?

HotTag

Archive