[lldb-dev] Interactive commands in LLDB

jingham at apple.com jingham at apple.com
Wed Feb 25 18:28:48 PST 2015


I would rather not conflate simple "confirm" dialogs and something really interactive like what you are describing.  For instance, if you run into a confirm dialog in a non-interactive environment (breakpoint command, for example) it makes sense to choose the default value and continue on.  But for an interactive command you probably want to do something else, either assume that the current data source (e.g. a "command source" file) is going to provide more data.

The IOHandlerConfirm does so little work, I don't think anyway you'd find all that much to reuse.  It seems to me better to make a new IOHandler class to deal with this more complex interaction.

Jim


> On Feb 25, 2015, at 6:09 PM, Siva Chandra <sivachandra at google.com> wrote:
> 
> 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
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev





More information about the lldb-dev mailing list