[lldb-dev] [Bug 46149] New: Python API: process will never stopped at a breakpoint when using LaunchSimple (lldb trunk)

via lldb-dev lldb-dev at lists.llvm.org
Sun May 31 22:02:08 PDT 2020


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

            Bug ID: 46149
           Summary: Python API: process will never stopped at a breakpoint
                    when using LaunchSimple (lldb trunk)
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: yangyibiao at hust.edu.cn
                CC: jdevlieghere at apple.com, llvm-bugs at lists.llvm.org

When using python api to debugging an executable, the process is never reaching
to a breakpoint. 
When using lldb in terminal, there is no such problem. 

Consider a python script:
...
$ cat test.py
#!/usr/bin/python3

import lldb
import os
import pdb

debugger = lldb.SBDebugger.Create()
debugger.SetAsync(False)

target = debugger.CreateTarget("./a.out")

if target:
    main_bp = target.BreakpointCreateByName("main",
target.GetExecutable().GetFilename())
    print(main_bp)

    process = target.LaunchSimple(None, None, os.getcwd())
    if process:
        print(process)

lldb.SBDebugger.Terminate()
...

the output from python:
...
$ python3 test.py
SBBreakpoint: id = 1, name = 'main', module = a.out, locations = 1
SBProcess: pid = 0, state = launching, threads = 0, executable = a.out
...



$ cat small.c
$ cat small.c
int a, b, d=1;

int main() {
  if (d)
    a = b==0;
  if (a!=1)
    return 1;
  return 0;
}

$ clang -g small.c


$ clang --version
Ubuntu clang version
11.0.0-++20200531052611+dfbfdc96f9e-1~exp1~20200531153245.58 
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

$ lldb --version
lldb version 11.0.0

$ python3 --version
Python 3.8.2

-- 
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/20200601/4114be78/attachment.html>


More information about the lldb-dev mailing list