Cannot get mac os x lldb process to read the STDIN

Ben picture Ben · Apr 25, 2015 · Viewed 7.4k times · Source

Is it me or lldb for mac os x (replacing gdb) does not allow you to pipe a file into the stdin, to be used by the process being debugged?

reading the instructions there is no reference to it.

I've gone through and installed gnu gdb, but would like to take advantage of what I suppose is improved lldb capability?

Answer

Jim Ingham picture Jim Ingham · Apr 28, 2015
(lldb) process launch -i <file>

Should do the trick. Note you can't say:

(lldb) run -i <file>

since run is an alias for process launch -- so all its arguments are passed to the process being launched.

There's a general "help" facility that can show you more about all the lldb commands.

(lldb) help process launch

would have shown you this option.