Cannot get lldb to read file input

风格不统一 提交于 2019-11-30 12:26:50

问题


I'm using lldb as a standalone debugger in OSX. I'm trying to debug a C executable, using a text file as input. The lldb documentation specifies the following command for changing stdin to a given file:

process launch -i <file>

Using this command, lldb seems to ignore the specified file, instead waiting for keyboard input.

Is this intended behaviour? If so; what do I need to do to actually get the process to operate on my wanted input file?

tl;dr: How do I get lldb to imitate a standard terminal execution like:

./executable < <file>

回答1:


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.



来源:https://stackoverflow.com/questions/35582881/cannot-get-lldb-to-read-file-input

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!