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

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


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

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.

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"
main_bp = target.BreakpointCreateByName ("main",
print main_bp
process = target.LaunchSimple (None, None, os.getcwd())
print process

On MacOSX, the output is:

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 the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20170313/57662443/attachment.html>

More information about the lldb-dev mailing list