[lldb-dev] Debugging a running process with lldb

Matthew Gardiner mg11 at csr.com
Thu May 15 01:53:19 PDT 2014


Matthew Gardiner wrote:
> Greg Clayton wrote:
>> If we launch a process and hookup a pty to its stdin/out/err, then we 
>> shouldn't get a prompt.
> Sorry, I don't understand this. Surely if we attach the inferior's 
> (i.e. what you termed the process) standard IOs to a pty, then we 
> *will* get a prompt, since then lldb can use it's terminal with no 
> corruption from the inferiors in/out?
>
> (I'm not actually clear about the relationship between the "process 
> launch" -t and -n commands. I do accept that they are mutually 
> exclusive. I assume, -n means that the stdin/out/err of the inferior 
> is closed, so that lldb has complete use of the foreground, so it 
> could use it's prompt. I assume -t means attach the inferior to a 
> different pty, so again, lldb should still be able to use it's prompt.)
>>   It is probably a bug where if you launch with --no-stdio that the 
>> LLDB prompt isn't always active.
>>
>> For attach, we will always have a prompt.
>>
>> So seems this is a bug that --no-stdio is still pushing a Process 
>> IOHandler and taking over the console while the process is running.
> So you are saying if I do
> (lldb) process launch -s --no-stdio
> then
> (lldb) process continue
>
> then I should always see:
> (lldb)
> back on my terminal?
>
> Todd, could you try this (a couple of times, in case I'm seeing 
> something intermittent) please, to see if your observations agree?
>
> thanks
> Matt
Hi Greg,

Actually, my colleague just brought his MacBook (OSX 10.9.2) into work, 
this morning. He installed pre-built xcode/lldb (lldb-310.2.37) on his 
Mac, and I can confirm that on mac, when we invoked:

(lldb) process launch -s -n
Process 1002 lanched....
(lldb) process continue
Process 1002 resuming
(lldb)

then we see the interpreter prompt return after the "continue". So what 
I reported originally is a linux build bug. (Perhaps I'll start digging 
into this, if I get any time...).

However, using  "process launch -s -t" on the mac, was buggy, a 
terminal-emulator was spawned, but (presumably) lldb and the child 
terminal fail to synchronise using the UNIX socket.

(lldb) process launch -s -t
error: failed to launch or debug process
(lldb)

Anyway, sorry for my earlier rant ;-), but at least now I'm a little 
clearer about the intended semantics...

Matt


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Keep up to date with CSR on our technical blog, www.csr.com/blog, CSR people blog, www.csr.com/people, YouTube, www.youtube.com/user/CSRplc, Facebook, www.facebook.com/pages/CSR/191038434253534, or follow us on Twitter at www.twitter.com/CSR_plc.
New for 2014, you can now access the wide range of products powered by aptX at www.aptx.com.



More information about the lldb-dev mailing list