[lldb-dev] Help RE: help for lldb command like gdb info sources & info source

Enrico Granata egranata at apple.com
Mon Sep 16 11:20:33 PDT 2013


Hi Yin,

it looks like you have an older version of LLDB
In order to make the “print >>result, …” syntax work, in ToT LLDB, there is a Python method write() implemented on the class SBCommandReturnObject
That function is probably not there in your version of LLDB

If you can, you could download open source ToT and build it yourself. Then, everything should work
Failing that, an alternative is to replace the print >> result, “foo" idiom with either just print “foo” or you could try one of result.PutCString(“foo”) / result.AppendMessage(“foo”) [1]

[1] unfortunately I can’t recall which one(s) was(were) available in LLDB-179, so you might have to give it a try

Enrico Granata
📩 egranata@.com
☎️ 27683

On Sep 15, 2013, at 10:49 PM, Yin Ma <yin at affinic.com> wrote:

> Hi Greg,
> 
> Thank you for sending sources.py. However, I still
> Cannot get it work on my Mac machine. I got this error
> After I do
> (lldb) command script import ~/sources.py
> (lldb) info_sources
> 
> Traceback (most recent call last):
>  File "/Users/yin/sources.py", line 22, in info_sources
> 
>  File "/Users/yin/sources.py", line 8, in dump_module_sources
>    print >> result, "Module: %s" % (module.file)
>  File "/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 1653, in <lambda>
>    __getattr__ = lambda self, name: _swig_getattr(self, SBCommandReturnObject, name)
>  File "/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/__init__.py", line 78, in _swig_getattr
>    raise AttributeError(name)
> AttributeError: write
> 
> I upgraded my system from snow leopard to the latest mountain lion.
> And I also upgraded lldb to 179.5. I got all same error like this.
> Could you help me to figure out how to fix it?
> 
> Thanks,
> 
> Yin
> 
> 
> -----Original Message-----
> From: Greg Clayton [mailto:gclayton at apple.com] 
> Sent: Tuesday, September 03, 2013 6:42 PM
> To: Yin Ma
> Cc: Jim Ingham; lldb-dev
> Subject: Re: [lldb-dev] help for lldb command like gdb info sources & info source
> 
> For this old of an LLDB you will need to put back ticks around the $pc:
> 
> (lldb) image lookup -va `$pc`
> 
> To get the file list, we can turn to python:
> 
> 
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20130916/54629567/attachment.html>


More information about the lldb-dev mailing list