Breakppoints and Stepping on Android

Sysprogs forums Forums VisualGDB Breakppoints and Stepping on Android

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #632
    cpuser
    Participant

    Hi,

    I am using NDK r9 and SDK 22.0.5 (API 18) and Debug APK. We’re using Ant to build.

    – If I try to add a breakpoint before running the executable and then run
    – or if I add the breakpoint while the executable is running,
    – or if I try to start the executable with adb with a raise(SIGINT) in the code and start Debug APK with attach to first instance before the raise(SIGINT) is hit,

    in all those cases, I am getting a dialog box saying:
    GDB Command Timeout
    The following GDB command is taking too long to complete:
    -file-list-exec-source-files
    ( I waited 500+ seconds )

    If I click on abort command it’s then showing a dialog box saying:
    GDB Command Timeout
    The following GDB command is taking too long to complete:
    -exec-continue

    If I then click on abort command. it says:
    Visual GDB
    Failed to start debugging session. GDB has reported the following error:
    Object reference not set to an instance of an object
    Please build your project first. If this does not help check GDB startup parameters in VisualGDB project settings.

    The short version is that I haven’t been able to use any breakpoint, and as a consequence I haven’t been able to try stepping.

    (I also tried to also use the Debugging Pause button of visual studio, and it does pause, but I don’t seem to get a correct callstack then for the Main Thread.
    It’s only 3 level deep, with the inner most level in an eopwait function (or something similar). The 2 other levels don’t seem to have symbols.
    If I try to step from there, I am getting the GDB timeout windows, I don’t remember the exact command it was trying to run).

    So before we make a purchase, I want to know if there’s a solution, or if the Debug APK command doens’t allow you to use breakpoint and step?

    Thanks!

    #2612
    cpuser
    Participant

    I forgot to mention, I am using a Nexus 7 and VisualGDB 4.0.

    #2613
    cpuser
    Participant

    Quick update. I had another case where I was able to set a breakpoint and step.

    I started the executable. One thread had an infinite loop in it.
    I used attach to existing instance
    I used debugger pause in visual
    I select the thread which had the infinite loop instead of the “main thread” which was just waiting (epoll_wait).
    I put a breakpoint in the code
    I got the timeout window, I said abort command
    I resumed, it actually hit my breakpoint
    and from there I was able to step.

    So I guess switching to the correct thread did the trick?
    That kind of solves my issue.

    The stepping is extremely slow, it’s taking about 2 seconds each time, is that expected?

    Thanks.

    #2614
    ket
    Participant

    Hi,

    Have you tried setting the “Disable -file-list-exec-source-files” option?
    With large projects polling all the source files at once tends to take a long time, how large is your project?

    The call stack can only show functions with symbols, i.e. you cannot step into system libraries as they are not built with symbols.

    As for the delay, are you using a Windows vm to run Visual Studio and channeling the USB connection of the Android device into the vm?

    Btw, VisualGDB also uses NDK and ant to build Android projects.

    #2611
    cpuser
    Participant

    Hi,

    Yes, “Disable -file-list-exec-source-files” seems to fix the issue and doesn’t seem to have any bad consequence for me, I am still getting the symbols and it still opens the files in Visual Studio. The breakpoints seem to work fine.

    Sorry I am totally new to Android and GDB, and I was just expecting a flowless Visual Studio-like experience 🙂
    I am using a native windows 7, no VM.

    By Ant I meant that we have a very complicated build process with our own makefiles for the native part and then ant to make the package, so I am just using the option to debug an APK I have built, I can’t really make a Visual Studio VisualGDB project.

    Thanks for the quick answer!

    #2615
    Anonymous
    Participant

    I have the same issue with a linux project I’m trying to debug however I don’t see the “Disable -file-list-exec-source-files” option. where would I find that for a linux project?
    I’m using VisualGDB 4.1

    #2616
    ket
    Participant

    Hi,

    The GDB settings option in VisualGDB Project Properties is called “Use relative source file paths instead of querying full path lists”.

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