[lldb-dev] lldb better shell support

Greg Clayton gclayton at apple.com
Mon Jul 9 16:30:11 PDT 2012


On Jul 8, 2012, at 5:37 AM, a a wrote:

> 1) on OSX, the bash shell works fine inside lldb, but upon entering script (python), it starts breaking: arrow keys don't work, etc so its impossible ot edit command line apart from using backspace key

We currently don't use any readline support inside of LLDB in the python interactive interpreter because we haven't had the time to implement it. It is trickier than it seems, but feel free to submit a patch that fixes this!

> 2) why not (optionally) support ascii codes to color the output (say, use different colors for  (lldb)  prompt, user commands and lldb outputs etc

We can, feel free to submit a patch. We have support for adding color codes to your thread and frame prompts:

http://lldb.llvm.org/formats.html

We could easily modify the prompt string to expand escape characters so you could do something like:

settings set prompt \033[0;33m(lldb)\033[0m

It would be nice to always feed the prompt string through Debugger::FormatPrompt() to allow for expansion of many things (like you saw in the formats.html web page). Again, feel free to submit a patch.

> 3) can python interpreter be configured? for example it would be nice to have ipython instead of python and have the bash completion enabled

The completion is done by the embedded interpreter and it currently isn't using readline as we can't assume the stdin/out/error for the interactive interpreter are coming from a terminal. It is possible to hook this up, we just haven't gotten to it. The class we used to drive our interactive interpreter is at:

lldb/source/Interpreter/embedded_interpreter.py

Feel free to submit any patches that enable readline functionality as we would love to have this.

Greg Clayton

> 
> (I'm using zsh if it matters)
> 
> _______________________________________________
> 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