无法使lldb读取文件输入 [英] Cannot get lldb to read file input
问题描述
我将lldb用作OSX中的独立调试器.我正在尝试使用文本文件作为输入来调试C可执行文件. lldb文档指定以下命令,用于将stdin更改为给定文件:
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>
使用此命令,lldb似乎忽略了指定的文件,而是等待键盘输入.
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:如何获取lldb来模仿标准的终端执行,例如:
tl;dr: How do I get lldb to imitate a standard terminal execution like:
./executable < <file>
推荐答案
我可以按以下方式工作:
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.
这篇关于无法使lldb读取文件输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!