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

Greg Clayton gclayton at apple.com
Mon Sep 16 11:23:24 PDT 2013


The LLDB in Xcode 4.6.3 doesn't have the SBCommandReturnObject output redirection built in..

Change any "print >> result, "

result.AppendMessage(

So the line:

   print >> result, "Module: %s" % (module.file)

Will need to be changed to:

   result.AppendMessage("Module: %s" % (module.file))



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:
> 
> 




More information about the lldb-dev mailing list