如何将gdb与输入重定向一起使用? [英] How to use gdb with input redirection?

查看:161
本文介绍了如何将gdb与输入重定向一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在终端中,我有

  myapp< myfileinput 

但是如果我想使用gdb,

  gdb myapp< myfileinput 

无法正常运行。



<如何在这里使用gdb?

解决方案

 〜$ gdb< executable> 

GNU gdb(Ubuntu / Linaro 7.3-0ubuntu2)7.3-2011.08
版权所有(C)2011自由软件基金会,Inc.
许可证GPLv3 +:GNU GPL版本3或更新版本; HTTP://gnu.org/licenses/gpl.html>
这是免费软件:您可以自由更改和重新分配它。
在法律允许的范围内,不存在任何担保。有关详细信息,请键入显示复制
和显示保修。
这个GDB被配置为i686-linux-gnu。
有关错误报告的说明,请参阅:
< http://bugs.launchpad.net/gdb-linaro/> ...
从/ home / abhishek / maxtest中读取符号...完成。

(gdb)运行< input.txt

这对我来说是个诀窍。想知道这是你在找什么。


in the terminal, i have

    myapp < myfileinput

But if I want to use gdb,

    gdb myapp < myfileinput

It didn't run correctly.

How to use gdb here?

解决方案

~$ gdb <executable>

GNU gdb (Ubuntu/Linaro 7.3-0ubuntu2) 7.3-2011.08
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/abhishek/maxtest...done.

(gdb) run < input.txt

This is doing the trick for me. Wondering if this was what you were looking for.

这篇关于如何将gdb与输入重定向一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆