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

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


            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

import lldb
import os
import pdb

debugger = lldb.SBDebugger.Create()

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

if target:
    main_bp = target.BreakpointCreateByName("main",

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


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
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 on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200601/489ea8f8/attachment.html>

More information about the llvm-bugs mailing list