[lldb-dev] [Bug 28989] New: lldb not sending SIGINT to inferior process

via lldb-dev lldb-dev at lists.llvm.org
Mon Aug 15 14:04:43 PDT 2016


            Bug ID: 28989
           Summary: lldb not sending SIGINT to inferior process
           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: penryu at apple.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16958
  --> https://llvm.org/bugs/attachment.cgi?id=16958&action=edit
Source file main.c used to reproduce issue

When lldb connects to a previously launchd process via pid, issuing ^C (Ctrl-C)
in the tty of the inferior process correctly sends SIGINT to the inferior
process. At this point, commands to `process handle SIGINT ...` can be used to
route the signal as the user wants.

However, if the inferior process is launched by lldb itself, either via `lldb
./some_bin` at the command line, or via `target create ...` from within lldb;
Ctrl-C is only received by lldb, and cannot be forwarded to the inferior
process as a SIGINT.

Note that sending a SIGINT to the debugged process with kill(1) or kill(2) will
work, but is only a workaround.

= Produce executable from attached source =

$ clang -g -o main main.c

= Attach to pid =

# launch ./main in separate tty

(lldb) pr at -p NNNNN
(lldb) pr ha SIGINT -p true -s false
(lldb) c

# issue ^C in tty running ./main
# ./main process exits via custom handler as intended

= Launch from inside lldb =

$ lldb
(lldb) ta cr ./main
(lldb) br s -n main
(lldb) r
Process NNNNN stopped ... stop reason = signal SIGSTOP
(lldb) pr ha SIGINT -p true -s false
(lldb) c
Process NNNNN stopped ... stop reason = signal SIGSTOP

# ^C never results in a SIGINT to inferior process

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/20160815/3c10e694/attachment.html>

More information about the lldb-dev mailing list