Reputation: 7168
As far as I know, lldb
supports automatic command execution when breakpoint is hit (similar to gdb
's commands
).
Manual says it should work like this:
(lldb) breakpoint command add 1.1
Enter your debugger command(s). Type 'DONE' to end.
> bt
> DONE
This one should output backtrace each time when breakpoint 1.1 is hit. I am trying to do the same thing in LLDB console in Android Studio 2.1.2 with NDK version 12b:
(lldb) breakpoint list
...
8: file = '/home/user/src_file.cpp', line = 2683, exact_match = 0, locations = 1, resolved = 1, hit count = 1
8.1: where = libdroid_shared.so`(anonymous namespace)::onDbgThreadResume() + 20 at src_file.cpp:2683, address = 0x0000007f9cad6740, resolved, hit count = 1
(lldb) breakpoint command add 8.1
(lldb) breakpoint command add 8.1
(lldb)
As you can see, the debugger does not offer me to enter commands. When I press Enter after breakpoint commmand add
line it just outputs empty line, and there's no command line prompt.
I tried both 32 and 64 bit debuggers, with different files, breakpoints and apps, but it does not work.
The same thing with gdb
's commands
works perfectly.
My questions:
Upvotes: 1
Views: 1101
Reputation: 27110
I don't know much about Android Studio, but this looks like it is a bug in Android studio or the lldb "MI" emulation layer in the handling of lldb's input callbacks (in this case the one prompting for the actual commands.)
If that's what it is, you can work around it by putting your commands in a file, then using the "one-line" input option like:
(lldb) br com add -o "com source /tmp/lldb.cmds"
Upvotes: 2