[lldb-dev] debug .lldbinit with python script?

Todd Fiala tfiala at google.com
Fri Jan 31 18:46:34 PST 2014


Hi Jun,

Yeah I agree our python script error reporting is a bit weak at the moment
(or I wasn't logging the right log channels).  What we did when we had to
import a complicated script was to first run our script through a lint tool
(like pylint) prior to feeding it to lldb.  At least that way you'll get
feedback if the script has any blatant issues in it.




On Fri, Jan 31, 2014 at 6:37 PM, Jun Koi <junkoi2004 at gmail.com> wrote:

>
>
>
> On Sat, Feb 1, 2014 at 1:28 AM, Greg Clayton <gclayton at apple.com> wrote:
>
>> "command script import" takes a path to a python file, not a module name:
>>
>
> but it also works with module name. give it a try.
> and in the case there is a bug, lldb doesnt report anything, but silently
> fails.
> hence my question is how to debug it.
>
>
>
>>
>> (lldb) command script import /tmp/mytest.py
>>
>> The "script" command then can then use it:
>> (lldb) script mytest.do_something()
>>
>> The "command script import" command will check to make sure the directory
>> in which the python module lives is already in python's module search paths
>> or not and it will add the directory to the imports list if needed.
>>
>
> hmm interesting. does "script" report errors in details if python code is
> buggy? i need to try this to see if it solves my issue.
>
> thanks,
> Jun
>
>
> On Jan 31, 2014, at 8:26 AM, Jun Koi <junkoi2004 at gmail.com> wrote:
>
> > hi,
> >
> > i am writing a small python script for .lldbinit, meaning i put
> something like this in ~/.lldbinit:
> >
> >        command script import mytest
> >
> > however, lldb silently fails to run "mytest", and i have no idea what is
> wrong.
> >
> > so question is: how can i debug my code? is there any way to turn on
> logging/debugging option, so lldb can let me know what is happening?
> >
> >
> > thanks.
> > Jun
> >
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
>
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>
>


-- 
Todd Fiala | Software Engineer | tfiala at google.com | 650-943-3180
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20140131/0a74d752/attachment.html>


More information about the lldb-dev mailing list