Can’t attach to Android process

Sysprogs forums Forums VisualGDB Can’t attach to Android process

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #935
    James
    Participant

    Hi;
    I installed Android Lollipop os, and I can’t connect to the device anymore. I get this error: error: only position independent executables (PIE) are supported.[/b

    I don’t have problems with the 4.3 Android version, and I can attach to process and debug fine with it.
    But with Android version 5, I have this issue.
    I am using VisualGDB 4.3(Beta 2).

    Any idea how to fix this?

    Thank you.

    GDB log:
    -gdb-set solib-search-path C:/Users/ali/AppData/Local/VisualGDB/AndroidBinaryCache/073b16be;C:/Dev/D15/Build/DuelsAndroid/Duels/obj/local/armeabi-v7a
    ^done
    Activating library load breakpoint bug workaround…
    -break-insert -f *0xb6fd2b78
    ^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”0xb6fd2b78″,at=””,times=”0″,original-location=”*0xb6fd2b78″}
    -target-select remote :5039
    ^error,msg=”putpkt: write failed: No error.”

    #3460
    support
    Keymaster

    Hi,

    This is a known limitation of recent Android versions. In short, you will need 2 versions of your native tool: one for Android 4.1+ and another one for the previous versions. Running the older one on the new OSes will show the message you are experiencing. You can read more about it here: http://stackoverflow.com/questions/24818902/running-a-native-library-on-android-l-error-only-position-independent-executab

    #3462
    James
    Participant

    Hi bazis; Thanks for the reply.

    I can get the application to run fine on Lollipop, what I can’t is attach the debugger to it.
    Is the fix you suggest applies for this issue?

    Many thanks;

    #3461
    support
    Keymaster

    Hi,

    This might be happening because you are building against an older platform version in NDK that installs an older gdbserver (tool required for debugging) that is incompatible with the new Android OS.
    Does switching the NDK platform to a more recent one solve the problem?

    #3458
    James
    Participant

    Thanks for the reply.
    Yes, one of the trials I did was to install the latest NDK and it did connects ok with it.

    #3459
    support
    Keymaster

    Then the simplest solution would be to use that newer NDK version in your debug configuration (the release one that does not need to be debugged can still be built against an older NDK).

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.