[llvm-bugs] [Bug 24759] The example "Using the lldb.py module in python" is not working on Linux

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Mar 13 05:08:11 PDT 2017


https://bugs.llvm.org/show_bug.cgi?id=24759

Louis.Granboulan.Developer at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #4 from Louis.Granboulan.Developer at gmail.com ---
I still have the same issue with lldb-3.9.
Here are more details, which may help to understand why it is not teh same for
you.

I compiled a C file containing only "int main(){}" in a binary at /tmp/a.out

Here is an extract from the script at
http://lldb.llvm.org/python-reference.html which reproduces the behaviour.

#!/usr/bin/python
import lldb, os, sys
exe = "/tmp/a.out"
debugger = lldb.SBDebugger.Create()
print debugger.GetVersionString()
debugger.SetAsync (False)
target = debugger.CreateTargetWithFileAndArch (exe, lldb.LLDB_ARCH_DEFAULT)
if not target:
    print "CreateTargetWithFileAndArch failed"
    sys.exit(1)
main_bp = target.BreakpointCreateByName ("main",
target.GetExecutable().GetFilename())
print main_bp
process = target.LaunchSimple (None, None, os.getcwd())
print process

On MacOSX, the output is:

lldb-360.1.70
Creating a target for '/tmp/a.out'
SBBreakpoint: id = 1, name = 'main', module = a.out, locations = 1
SBProcess: pid = 10449, state = stopped, threads = 1, executable = a.out

On Linux, where lldb-3.9.1 is installed using the apt repository from
http://apt.llvm.org/jessie/ the output is:

lldb version 3.9.1 ( revision )
SBBreakpoint: id = 1, name = 'main', module = a.out, locations = 1
SBProcess: pid = 0, state = launching, threads = 0, executable = a.out


It is not the same output, and the fact that the process is "launching" rather
than "stopped" makes the rest of the script from
http://lldb.llvm.org/python-reference.html useless.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170313/d93b1151/attachment.html>


More information about the llvm-bugs mailing list