Cannot get lldb to read file input through redirect

后端 未结 2 344
故里飘歌
故里飘歌 2020-12-24 15:04

I\'m using lldb as a standalone debugger in OSX. I\'m trying to debug a C executable, using a text file as input, by way of a redirect. The lldb do

相关标签:
2条回答
  • 2020-12-24 15:16

    I got it to work as follows:

    lldb <executable>
    (lldb) settings set target.input-path <file>
    (lldb) process launch
    

    It solves my problem, but I don't really have an explanation for why the method in my question doesn't work.

    0 讨论(0)
  • 2020-12-24 15:25

    I'm a few years late but, should someone else find their way here the following will be helpful: This website contains a multitude of ways in which lldb can do all of the same things as gdb. Of course, if you don't care about gdb you can always use the lldb commands list on its own. To answer the question more specifically, and this is repeated at the website linked above, you can do the following to run an executable that takes arguments:

    lldb <executable>
    (lldb) process launch -- <whatever your args may be e.g. a file path>
    

    or

    (lldb) run <args>
    

    or just

    (lldb) r <args>
    
    0 讨论(0)
提交回复
热议问题