[lldb-dev] Various questions about lldbinit and python scripts.

Jean-Yves Avenard jyavenard at gmail.com
Mon Oct 7 17:19:02 PDT 2013


Hello

Thanks for answering!... very much appreciated

On 8 October 2013 10:40, Greg Clayton <gclayton at apple.com> wrote:

> This works for me currently using the exact source for cmdtemplate.py:

duh.. I feel silly.

I had called the script lldbfunc.py
After I changed:
    debugger.HandleCommand('command script add -f
cmdtemplate.the_framestats_command framestats')

into:
    debugger.HandleCommand('command script add -f
lldbfunc.the_framestats_command framestats')

then it works...

It's a bit of a worry though when the code being run in a file is
dependent on the name of that file !
> Have you installed your own python? Do you see a ton of files when you execute this shell command?:
>
> % find /System/Library/Frameworks/Python.framework

30271 files to be precise... with python 2.3 framework all the way down to 2.7

> It should just work as long as you haven't messed with your python installation. We currently assume the system default of Python 2.7.

I have some alternative python installed (through macport), but they
are in /opt/local and not in my path.

Only reason I played with PYTHONPATH was while troubleshooting why it
didn't work.

>
> You will want to first get python working. Then you will want to implement a python summary function:
>
> http://lldb.llvm.org/varformats.html
>
> See the section labeled "PYTHON SCRIPTING".

Thanks for the heads up... I'll have a look.

I already got QString to be displayed properly by changing the summary
format with:
{(const char *)$VAR.toUtf8().constData()}:s

not sure if you're familiar with xcode summary format, but that may be
an easier approach than messing with python scripts. Is there a way to
do loops in there (so I could display the content of loop and map
container)..

Thanks again
JY



More information about the lldb-dev mailing list