是否可以将调试会话附加到 eclipse CDT 中正在运行的程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/655853/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to attach a debugging session to a running program in eclipse CDT
提问by stu
I'm writing a netscape iplanet plugin (on solaris/C using eclipse) which is basically a shared object with specific entry points, and I'd like to be able to debug the shared object with eclipse's debugger (gdb). I remember doing something similar in AIX where you could make xldb attach to a running process. Is it possible to get eclipse to run gdb to attach to a running binary? And should I expect grief because I want to debug a dynamically loaded piece of code?
我正在编写一个 netscape iplanet 插件(在 solaris/C 上使用 eclipse),它基本上是一个具有特定入口点的共享对象,我希望能够使用 eclipse 的调试器 (gdb) 调试共享对象。我记得在 AIX 中做过类似的事情,你可以让 xldb 附加到正在运行的进程。是否可以让 eclipse 运行 gdb 以附加到正在运行的二进制文件?我应该因为我想调试一段动态加载的代码而感到悲伤吗?
回答by lothar
Yes it is. You need to go to the Lauch Configuration Dialog and select "C++ Attach to ...". Depending on your Eclipse version there may be only one or more "C++ Attach to ..." variants available.
是的。您需要转到 Lauch Configuration Dialog 并选择“C++ Attach to ...”。根据您的 Eclipse 版本,可能只有一个或多个“C++ Attach to ...”变体可用。
回答by Paulo Guedes
I use Eclipse CDT for HP/UX remote environment. I'm not sure whether it will work for you:
我将 Eclipse CDT 用于 HP/UX 远程环境。我不确定它是否适合你:
have your app running on unix
go to Run / Debug Configurations / C/C++ Attach to Remote
click Debug and a list of processess will be shown
select the process you want to debug.
让你的应用在 unix 上运行
转到运行/调试配置/C/C++ 附加到远程
单击调试,将显示进程列表
选择要调试的进程。