<div dir="ltr">Hi Jun,<div><br></div><div>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.</div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jan 31, 2014 at 6:37 PM, Jun Koi <span dir="ltr"><<a href="mailto:junkoi2004@gmail.com" target="_blank">junkoi2004@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><div class="im">On Sat, Feb 1, 2014 at 1:28 AM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">"command script import" takes a path to a python file, not a module name:<br></blockquote><div><br></div></div>
<div>
but it also works with module name. give it a try. <br></div><div>and in the case there is a bug, lldb doesnt report anything, but silently fails.<br></div><div>hence my question is how to debug it.<br></div><div class="im">
<div><br></div>
<div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
(lldb) command script import /tmp/mytest.py<br>
<br>
The "script" command then can then use it:<br>
(lldb) script mytest.do_something()<br>
<br>
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.<br>
</blockquote><div><br></div></div><div>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.<br><br>thanks,<br></div><div>Jun<div class="im">
<br><br><div><div>
On Jan 31, 2014, at 8:26 AM, Jun Koi <<a href="mailto:junkoi2004@gmail.com" target="_blank">junkoi2004@gmail.com</a>> wrote:<br>
<br>
> hi,<br>
><br>
> i am writing a small python script for .lldbinit, meaning i put something like this in ~/.lldbinit:<br>
><br>
> command script import mytest<br>
><br>
> however, lldb silently fails to run "mytest", and i have no idea what is wrong.<br>
><br>
> 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?<br>
><br>
><br>
> thanks.<br>
> Jun<br>
><br>
</div></div>> _______________________________________________<br>
> lldb-dev mailing list<br>
> <a href="mailto:lldb-dev@cs.uiuc.edu" target="_blank">lldb-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br>
</div></div></div><br></div></div>
<br>_______________________________________________<br>
lldb-dev mailing list<br>
<a href="mailto:lldb-dev@cs.uiuc.edu">lldb-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><table cellspacing="0" cellpadding="0" style="color:rgb(136,136,136);font-family:'Times New Roman'"><tbody><tr style="color:rgb(85,85,85);font-family:sans-serif;font-size:small">
<td nowrap style="border-top-style:solid;border-top-color:rgb(213,15,37);border-top-width:2px">Todd Fiala |</td><td nowrap style="border-top-style:solid;border-top-color:rgb(51,105,232);border-top-width:2px"> Software Engineer |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(0,153,57);border-top-width:2px"> <a href="mailto:tfiala@google.com" style="color:rgb(17,85,204)" target="_blank"><span style="background-color:rgb(255,255,204);color:rgb(34,34,34);background-repeat:initial initial">tfiala@google.com</span></a> |</td>
<td nowrap style="border-top-style:solid;border-top-color:rgb(238,178,17);border-top-width:2px"><font color="#1155cc"> <a>650-943-3180</a></font></td></tr></tbody></table><br></div>
</div>