[lldb-dev] python command returns different values in a script and interactively

Ted Woodward ted.woodward at codeaurora.org
Tue Aug 12 15:15:44 PDT 2014

I'm trying to write a python script that will launch a simulator to run the
current target. In my script, I've got this code:

    foo = lldb.target.GetExecutable().__get_fullpath__()

    print foo

    print type(foo)


When I run it, I get this:


<type 'NoneType'>


But if I run the same commands interactively, I get the right values:

(lldb) script foo = lldb.target.GetExecutable().__get_fullpath__()

(lldb) script print foo


(lldb) script print type(foo)

<type 'str'>


After calling lldb.target.GetExecutable().__get_fullpath__() interactively,
my script starts to work.


Why doesn't it work in the script if I don't call it interactively? How can
I get it to work?





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

More information about the lldb-dev mailing list