[Android] Debugging with gdb.sh

Andrey Gursky andrey.gursky at e-mail.ua
Tue May 31 02:17:47 CEST 2016


On Mon, 30 May 2016 09:22:46 +0200
Thomas Guillem <thomas at gllm.fr> wrote:

> 
> On Mon, May 30, 2016, at 01:34, Andrey Gursky wrote:
> > On Sun, 29 May 2016 16:01:50 +0200
> > Andrey Gursky <andrey.gursky at e-mail.ua> wrote:
> > 
> > > 
> > > Summary:
> > > - r10e: doesn't recognize a debug build of VLC-Android at all.
> > > - r11c: can't run gdbserver from non-app path /data/local/tmp
> > >         (on Android 4.4.4).
> 
> 
> Could you try again with ndk11c after applying the enclosed patch in
> your ANDROID_NDK path ?

>      # Copy gdbserver into the data directory on M+, because selinux prevents
>      # execution of binaries directly from /data/local/tmp.
> -    if get_api_level(args.props) >= 23:
> +    if get_api_level(args.props) >= 21:

Thomas, thanks for the hint. Replacing API 23 with 19 did the trick.
People at Google have forgotten, that they introduced selinux much much
earlier?..

Not important, just to mention, that there is another small bug in the
NDK r11c:
---------
Found application data directory: /data/data/org.videolan.vlc.debug
App gdbserver not found at /data/data/org.videolan.vlc.debug/lib/gdbserver, uploading.
Copying gdbserver to /data/data/org.videolan.vlc.debug/arm-gdbserver.
Uploaded gdbserver to /data/data/org.videolan.vlc.debug/arm-gdbserver
----------

ndk-gdb.py script checks for gdbserver in:
/data/data/org.videolan.vlc.debug/lib/gdbserver
but copies it into:
/data/data/org.videolan.vlc.debug/arm-gdbserver

Different path and even different file name.

> > > 
> > > I believe removing gdb.setup and gdbserver (git 6ae7318b58b) from .apk
> > > causes both failures (directly or indirectly).
> > 
> > That is indeed the reason. Meanwhile I've found partially solution for
> > gdb files inclusion in the .apk, which I'd have to tune yet.
> > 

BTW, I've noticed that gdb.setup, gdbserver and libcompat.7.so are
placed into assets. Is it accidentally?

$ 7z l vlc-android/build/outputs/apk/VLC-Android-1.9.12-ARMv7.apk | grep -e gdb -e libcompat
2016-05-30 01:29:36 .....          230          131  assets/gdb.setup
2016-05-30 01:29:36 .....       579940       326992  assets/gdbserver
2016-05-30 01:29:36 .....        25720         8738  assets/libcompat.7.so
2016-05-30 01:29:36 .....         5212          923  lib/armeabi-v7a/libcompat.7.so

Regards,
Andrey


More information about the Android mailing list