[lldb-dev] writing an extension command in Python

Cameron McCormack cam at mcc.id.au
Tue Jan 4 15:11:53 PST 2011


I guess this is more of a user question than a dev question, but since
there is no user mailing list I hope that it’s OK to post here!

I want to write an extension command in Python that would work something
like this:

  (lldb) showimage 300 200 <some-expr-that-evaluates-to-a-pointer>

which grabs the data at the pointer and goes off and writes it to a file
as a PNG, or pops up a window showing the image, or something like that.

How do I go about writing the extension?  I see there is this disasm.py
example, but that seems to be controlling lldb from Python rather than
registering an extension to be called from the lldb prompt.

Also, is there documentation yet on how to use the API?  The C++ headers
in include/lldb/API don’t seem to have doxygen comments.  (I can
probably fumble my way through working out the Python API from the C++
one, if it is documented.)



Cameron McCormack ≝ http://mcc.id.au/

More information about the lldb-dev mailing list