1

I'm debugging an interactive, command-line program with lldb. The program presents its own prompt to the user (in a manner similar to fdisk).

My question is, how do I escape, or get back to, the lldb prompt while I'm executing the program?

Here's how I go about launching the program and getting to the point that I'm inquiring about:

bash$ lldb progname progarg1
(lldb) target create "progname"
Current executable set to 'progname' (x86_64).
(lldb) settings set -- target.run-args "progarg1"
(lldb) process launch
Process launched Process 29286 launched: '/home/chb/progdir/progname' (x86_64)
progname>help
Commands are:
    buy:   use schmeckles to buy a plumbus
    lube:  rub with the fleeb
    ...
progname>

After entering the program's command loop, how do I get back to lldb to issue other, lldb-related commands?

2
  • 2
    If you are debugging a program that makes heavy use of the Terminal, it's often more convenient to give it its own terminal. Just open another terminal window, note the device - you can get Terminal.app to print the TTY, then when you launch the program (/dev/ttys001 or some such) pass this to the --tty option. Then you don't have to worry about the output from the two getting intermixed. Commented Jul 8, 2019 at 16:59
  • @JimIngham This is solid comment gold. Thanks. Commented Jul 8, 2019 at 20:12

1 Answer 1

2

Hitting Control-C on your keyboard interrupts the program and lldb takes control.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.