Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to switch between lldb and GDB in Android Studio

While trying to debug a JNI project, I see this image after choosing "run" > "edit configuration": RunConfigurationPic According to NDK documents I should see this and be able to choose between lldb and GDB. Does anyone know how to do this on the new Android Studio? I am asking because I do not see my break points in my native code. Here is what I have: enter image description here

like image 826
user3326293 Avatar asked Sep 20 '15 22:09

user3326293


People also ask

Is LLDB better than GDB?

The main difference between LLDB and GDB is that in LLDB, the programmer can debug programs written in C, Objective C and C++ while, in GDB, the programmer can debug programs written in Ada, C, C++, Objective C, Pascal, FORTRAN and Go.

How to debug in LLDB?

Loading a Program into lldb First we need to set the program to debug. As with gdb, you can start lldb and specify the file you wish to debug on the command line: $ lldb /Projects/Sketch/build/Debug/Sketch. app Current executable set to '/Projects/Sketch/build/Debug/Sketch.

Can LLDB connect to Gdbserver?

LLDB supports GDB server that QEMU uses, so you can do the same thing with the previous section, but with some command modification as LLDB has some commands that are different than GDB You can run QEMU to listen for a "GDB connection" before it starts executing any code to debug it.

What is LLDB in Android Studio?

Android Studio attaches both the Java debugger and LLDB to your app process, one for the Java debugger and one for LLDB, so you can inspect breakpoints in both your Java and native code without restarting your app or changing your debug configuration.


1 Answers

Try that: Open the sdk manager (Tools->android->sdk manager) then go in the tab "SDK Tools" and there check "LLDB".

Then:

  • Make sure you have selected a native run configuration (The default one is called "app-native"
  • Make sure you have selected a "Debug" variant (Bottom left, click on variant and select a "Debug")
  • Launch in debug (not the "play" green triangle, but the small bug on its right side)

This works for me with Android Studio 2.0 Preview, Gradle 2.9 and experimental plugin 0.6.0-alpha1

like image 65
Sistr Avatar answered Oct 10 '22 19:10

Sistr