2
幫助,我該如何解決這個問題?我無法將命令從stdin重定向到gdb。gdb管道重定向錯誤:(gdb)在fd上檢測到掛機0
我得到這個錯誤:
[email protected]:~/workspace/AVT$ echo "list" | gdb a.out
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/charmae/workspace/AVT/a.out...done.
(gdb) Hangup detected on fd 0
error detected on stdin
我的目標是修復上面顯示的錯誤..我正在做我的Java程序和gdb之間的管道,我堅持下去。 – Chinwei
該示例的問題是您正在關閉stdin。如果你能保持管道暢通,gdb會很高興。例如(這是一個可怕的黑客攻擊),你可以做「tail -f input-file | gdb」,然後讓jave程序寫入輸入文件。 –
Yey!我能夠在我的java程序和gdb之間運行管道。 進程p = Runtime.getRuntime()。exec(「gdb a.out --interpreter = console」); – Chinwei