I'm trying to get debugging working in Android Studio for Native Applications.
I am able to get lldb connected and responding but cannot get a valid frame. After much googling I believe the reason for the invalid frames is because LLDB does not know how to read the registers correctly. If this is the case, it looks that this could be solved by loading a target definitions file into LLDB. Anyway, before going further I wanted to put this out there in case somebody else has run into this and has some suggestions.My Setup:
Dev machine: Windows 8.1, Android Studio 1.4.1, ovr_sdk_mobile_22.214.171.124
Android Device: S6, Android 5.0.2
Connected via USBMy Steps:
1. Setup Android studio as explained here: https://developer.oculus.com/documentat ... droid-win/
2. Setup a Native debug project as explained here: https://developer.oculus.com/documentat ... dio-debug/
2a. Updated AndroidManifest.xml to use SDK version 21: <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="21" />
3. Click "Debug" to start (using VrCubeWorld_Framework-DEBUG).
-- I can see lldb-server is pushed to device
-- on device I can see lldb-server is running and mostly working
4. Click "Pause" in debugger twice. For some reason first click is ignored.
6. Go to "Debugger -> LLDB" window and I have a nice (lldb) prompt that works!
7. If I look at threads or "process status" I get this:
* thread #1: tid = 16327, name = 's.vrcubeworldfw', stop reason = signal SIGSTOP
frame #0: 0xffffffffffffffff
.. and a bunch of other threads like "mali-utility-wo" and "OVR::VrThread" ...7a. Notice my frame is garbage: 0xffffffffffffffff
8. Googling around and looking at my logs leads me to believe that LLDB doesn't know how to read the registers correctly.
8a. Here is a post where they loaded a target definition file to resolve similar symptom: http://ddeville.me/2015/08/using-the-vm ... with-lldb/
8b. Here is an example of types of messages I see in my "gdb-server.log": "GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread failed to get register info for register set 'General Purpose Registers', register index 0"
I'm not sure if this matters but I noticed that the lldb-server that gets uploaded to the device is an arm64-v8a binary while all of our code is armeabi-v7a binaries.
Maybe if I could get an armeabi-v7a target definitions file I could make this work but thus far I have not been able to find one anywhere online.
If you have debugging working or have suggestions I would appreciate them. Thanks.
I have attached my gdb-server.log for reference.