Using command files in lldb

Hi
How do I use command file is lldb

I tried :

$ lldb -s cmdfile output

The content of the cmd file is :

r

I get the following error on running the above command

error: Aborting reading of commands after command #0: 'r ’ failed with error: invalid target, create a target using the ‘target create’ command
Current executable set to ‘output’ (x86_64).

Can you kindly tell me what is the right way to do this ?

Thanks
Prakash

Try adding:
    target create "file"
to the start of your cmdfile.

That said, I tried this myself on OSX and it looks like there are timing
issues (I'm speculating here). For me, it never got past the "r" and had
to cntl-C twice to get out. I tested on an OSX C++ "hello world" console
app with the command file:

    target create "/tmp/x"
    b main
    r
    n
    c
    q

What lldb are you using? Greg and I just fixed some issues with getting the code from -s and -o options to work correctly. Current TOT lldb handles this case correctly.

Jim

It works with your fixes. Thanks guys!