23

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?

Ebad Masood
  • 2,389
  • 28
  • 46
Ben
  • 1,292
  • 1
  • 13
  • 21
  • I had the same issue and figured out a solution, as can be seen here: [Stackoverflow: cannot get lldb to read file input](http://stackoverflow.com/questions/35582881/cannot-get-lldb-to-read-file-input) – Harald Husum Apr 17 '16 at 14:36

1 Answers1

48
(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.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63
  • @Ben, can you mark this as the correct answer? It worked for me, I'm assuming it worked for you as well. – zapstar Apr 26 '16 at 18:02
  • did NOT work for me on MacOS, however the solution in https://stackoverflow.com/questions/29861242/cannot-get-mac-os-x-lldb-process-to-read-the-stdin did work. – Klapaucius Klapaucius Oct 18 '22 at 23:47