[lldb-dev] Interactive commands in LLDB

Siva Chandra sivachandra at google.com
Wed Feb 25 18:09:51 PST 2015


Hello,

This is more like a question through a proposal on how to add
interactive commands to LLDB.

By an interactive command, I mean that when one runs the command, it
asks for more input from the user. AFAICT, there is no way currently
to do that in LLDB. There is an IOHandlerConfirm which can be used to
get a yes/no response from the user, but what I am looking for is
something which can read in "richer" inputs. Could we extend
IOHandlerConfirm as follows:

1. Rename IOHandlerConfirm to IOHandlerUserResponse
2. To support the existing use case of "confirm", add two methods,
UserResponseIsYes and UserResponseIsNo to it.
3. Make its GetResponse method return the raw user input.
4. Add few convenience methods to it like GetResponseAsUint8,
GetResponseAsString etc.

The above is a big picture idea; there could be a few details to
resolve when getting down to implementation. My motivation to require
a facility like this is to implement something like the "explore"
command of GDB:
https://sourceware.org/gdb/current/onlinedocs/gdb/Data.html.

Thanks,
Siva Chandra



More information about the lldb-dev mailing list