[Android] Debugging with gdb.sh
Thomas Guillem
thomas at gllm.fr
Tue May 31 09:15:27 CEST 2016
On Tue, May 31, 2016, at 02:17, Andrey Gursky wrote:
> 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
Indeed, gdb* should not be in assets.
For libcompat.7.so, we need it to support android froyo and before, and
it's quite ugly
https://code.videolan.org/videolan/vlc-android/blob/master/vlc-android/src/org/videolan/vlc/util/VLCInstance.java#L109
>
> Regards,
> Andrey
More information about the Android
mailing list