如何使用Eclipse CDT进行远程调试而不使用gdbserver?

时间:2023-01-13 11:26:58

We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host.

我们在Windows上使用Eclipse CDT 5 C ++ IDE在远程AIX主机上开发C ++应用程序。

Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX.

Eclipse CDT能够使用gdbserver执行远程调试。不幸的是,AIX上不支持gdbserver。

Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb?

是否有人熟悉使用Eclipse CDT远程调试而无需gdbserver?也许使用SSH shell连接到gdb?

3 个解决方案

#1


11  

finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging.

最后我现在无论如何都得到了远程运行的gdb。在任务栏上的Bug符号中,我进行了调试配置 - GDB硬件调试。

In Main C/C++ Applications I set the full path on the Samba share of the executable (X:\abin\vlmi9506). I also set a linked folder on X:\abin in the project. Then I modified my batch-script in GDB Setup. It's not directly calling gdb in the plink-session but a unix-shell-script, which opens gdb. By this I have the possibility to set some unix environment-variables for the program before doing debug. The call in my batch:

在主C / C ++应用程序中,我在可执行文件的Samba共享上设置完整路径(X:\ abin \ vlmi9506)。我还在项目的X:\ abin上设置了一个链接文件夹。然后我在GDB安装程序中修改了我的批处理脚本。它不是直接在plink-session中调用gdb而是直接调用unix-shell-script来打开gdb。通过这种方式,我可以在进行调试之前为程序设置一些unix环境变量。我的批次中的电话:

plink.exe prevoax1 -l suttera -pw XXXXX -i /proj/user/dev/suttera/vl/9506/test/vlmi9506ddd.run 20155 dev o m

In the unix script I started gdb with the command line params from eclipse, that I found in my former tryals. The call in the shell command looks like this:

在unix脚本中,我使用eclipse中的命令行params启动了gdb,这是我在以前的tryals中找到的。 shell命令中的调用如下所示:

gdb -nw -i mi -cd=$LVarPathExec $LVarPathExec/vlmi9506

Then IBM just gives gdb 6.0 for AIX. I found version 6.8 in the net at http://www.perzl.org/aix/index.php?n=Main.Gdb. Our Admin installed it.

然后IBM就为AIX提供了gdb 6.0。我在http://www.perzl.org/aix/index.php?n=Main.Gdb网上找到了6.8版本。我们的管理员安装了它

I can now step through the program and watch variables. I even can write gdb-commands directly in the console-view. yabadabadooooooo

我现在可以逐步完成程序并观察变量。我甚至可以直接在console-view中编写gdb-commands。 yabadabadooooooo

Hope that helps to others as well. Can not tell, what was really the winner-action. But each answer gives more new questions. Now I got 3 of them.

希望对其他人也有帮助。不能说,真正的赢家行动是什么。但每个答案都提出了更多新问题。现在我有3个。

  1. When I start the debug config I have to click restart in the toolbar to come really in the main procedure. Is it possible to come directly in main without restarting?
  2. 当我启动调试配置时,我必须单击工具栏中的重启才能真正进入主程序。是否有可能直接进入主要而不重新启动?

  3. On AIX our programs are first preprocessed for embedded sql. The preprocessed c-source is put in another directory. When I duble-click the line to set a breakpoint, I get the warning "unresolved breakpoint" and in the gdb-console I see, that the break is set to the preprocessed source which is wrong. Is it possible to set the breakpoints on the right source?
  4. 在AIX上,我们的程序首先针对嵌入式sql进行了预处理。预处理的c-source放在另一个目录中。当我单击该行以设置断点时,我收到警告“未解析的断点”,并且在gdb-console中我看到,break被设置为预处理的源,这是错误的。是否可以在正确的源上设置断点?

  5. We are using CICS on AIX. With the xldb-Debugger and the CDCN-command of CICS we manage that debugging is started, when we come in our programs. Is it possible to get that remotely (in plink) with gdb-eclipse as well?
  6. 我们在AIX上使用CICS。使用xldb-Debugger和CICS的CDCN命令,当我们进入程序时,我们管理调试开始。是否有可能使用gdb-eclipse远程(在plink中)获得?

#2


1  

I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one has sat around for a day, I'll give it a shot. It seems from looking at:

在一个我无法真正测试答案的问题上,我通常不会在黑暗中拍摄,但由于这个问题已经坐了一天,我会试一试。看起来似乎:

http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F

...that even if the CDT has changed since that wiki page was made, you should still be able to change the debug command to:

...即使CDT在创建维基页面后发生了变化,您仍然可以将调试命令更改为:

ssh remotehost gdb

ssh remotehost gdb

instead of using TM which uses gdbserver. This will probably be slightly slower than the TM remote debugging since that actually uses a local gdb, but on the other hand this way you won't have to NFS or SMB mount your source code to make it available to the local debugger (and if you're on a LAN it probably won't matter anyhow).

而不是使用使用gdbserver的TM。这可能比TM远程调试略慢,因为它实际上使用本地gdb,但另一方面,您不必使用NFS或SMB安装源代码以使其可供本地调试器使用(如果你在局域网上,无论如何都无所谓。

There's also a reference TCF implementation for linux, which you may or may not have any luck recompiling for AIX, but it allows for remote debugging if gdbserver is otherwise not available:

还有一个针对linux的参考TCF实现,你可能有或没有运气重新编译AIX,但它允许远程调试,如果gdbserver不可用:

http://wiki.eclipse.org/DSDP/TM/TCF_FAQ

#3


0  

tried also to remotly debug an aix-appl with windows eclipse-cdt-gdb. Got blocked at the end with unix/windows path-problems. Maybe my result can help u a little further - maybe you already got it work. I'm interested in your comment. asked on eclipse news portal- following the answer of martin oberhuber (thanks again) tried dsp dd (also blocked with path problem) and set an request in eclipse bugzilla.

我还尝试用windows eclipse-cdt-gdb远程调试aix-appl。最后因unix / windows路径问题而被阻止。也许我的结果可以帮助你更进一步 - 也许你已经有了它的工作。我对你的评论感兴趣。在eclipse新闻门户网站上问道 - 按照martin oberhuber的回答(再次感谢)尝试了dsp dd(也阻止了路径问题)并在eclipse bugzilla中设置了一个请求。

here the link to news: http://www.eclipse.org/newsportal/article.php?id=406&group=eclipse.dsdp.tm Here my bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=252758

这里有新闻链接:http://www.eclipse.org/newsportal/article.php?id = 406&group = eclipse.dsdp.tm这里我的bugzilla:https://bugs.eclipse.org/bugs/show_bug.cgi ?ID = 252758

At the moment we still debug localy with xldb but I am trying ddd-gdb at the moment. At least locally gdb is running.

目前我们仍然使用xldb调试localy,但此刻我正在尝试ddd-gdb。至少本地gdb正在运行。

#1


11  

finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging.

最后我现在无论如何都得到了远程运行的gdb。在任务栏上的Bug符号中,我进行了调试配置 - GDB硬件调试。

In Main C/C++ Applications I set the full path on the Samba share of the executable (X:\abin\vlmi9506). I also set a linked folder on X:\abin in the project. Then I modified my batch-script in GDB Setup. It's not directly calling gdb in the plink-session but a unix-shell-script, which opens gdb. By this I have the possibility to set some unix environment-variables for the program before doing debug. The call in my batch:

在主C / C ++应用程序中,我在可执行文件的Samba共享上设置完整路径(X:\ abin \ vlmi9506)。我还在项目的X:\ abin上设置了一个链接文件夹。然后我在GDB安装程序中修改了我的批处理脚本。它不是直接在plink-session中调用gdb而是直接调用unix-shell-script来打开gdb。通过这种方式,我可以在进行调试之前为程序设置一些unix环境变量。我的批次中的电话:

plink.exe prevoax1 -l suttera -pw XXXXX -i /proj/user/dev/suttera/vl/9506/test/vlmi9506ddd.run 20155 dev o m

In the unix script I started gdb with the command line params from eclipse, that I found in my former tryals. The call in the shell command looks like this:

在unix脚本中,我使用eclipse中的命令行params启动了gdb,这是我在以前的tryals中找到的。 shell命令中的调用如下所示:

gdb -nw -i mi -cd=$LVarPathExec $LVarPathExec/vlmi9506

Then IBM just gives gdb 6.0 for AIX. I found version 6.8 in the net at http://www.perzl.org/aix/index.php?n=Main.Gdb. Our Admin installed it.

然后IBM就为AIX提供了gdb 6.0。我在http://www.perzl.org/aix/index.php?n=Main.Gdb网上找到了6.8版本。我们的管理员安装了它

I can now step through the program and watch variables. I even can write gdb-commands directly in the console-view. yabadabadooooooo

我现在可以逐步完成程序并观察变量。我甚至可以直接在console-view中编写gdb-commands。 yabadabadooooooo

Hope that helps to others as well. Can not tell, what was really the winner-action. But each answer gives more new questions. Now I got 3 of them.

希望对其他人也有帮助。不能说,真正的赢家行动是什么。但每个答案都提出了更多新问题。现在我有3个。

  1. When I start the debug config I have to click restart in the toolbar to come really in the main procedure. Is it possible to come directly in main without restarting?
  2. 当我启动调试配置时,我必须单击工具栏中的重启才能真正进入主程序。是否有可能直接进入主要而不重新启动?

  3. On AIX our programs are first preprocessed for embedded sql. The preprocessed c-source is put in another directory. When I duble-click the line to set a breakpoint, I get the warning "unresolved breakpoint" and in the gdb-console I see, that the break is set to the preprocessed source which is wrong. Is it possible to set the breakpoints on the right source?
  4. 在AIX上,我们的程序首先针对嵌入式sql进行了预处理。预处理的c-source放在另一个目录中。当我单击该行以设置断点时,我收到警告“未解析的断点”,并且在gdb-console中我看到,break被设置为预处理的源,这是错误的。是否可以在正确的源上设置断点?

  5. We are using CICS on AIX. With the xldb-Debugger and the CDCN-command of CICS we manage that debugging is started, when we come in our programs. Is it possible to get that remotely (in plink) with gdb-eclipse as well?
  6. 我们在AIX上使用CICS。使用xldb-Debugger和CICS的CDCN命令,当我们进入程序时,我们管理调试开始。是否有可能使用gdb-eclipse远程(在plink中)获得?

#2


1  

I wouldn't normally take a shot in the dark on a question I can't really test the answer to, but since this one has sat around for a day, I'll give it a shot. It seems from looking at:

在一个我无法真正测试答案的问题上,我通常不会在黑暗中拍摄,但由于这个问题已经坐了一天,我会试一试。看起来似乎:

http://wiki.eclipse.org/TM_and_RSE_FAQ#How_can_I_do_Remote_Debugging_with_CDT.3F

...that even if the CDT has changed since that wiki page was made, you should still be able to change the debug command to:

...即使CDT在创建维基页面后发生了变化,您仍然可以将调试命令更改为:

ssh remotehost gdb

ssh remotehost gdb

instead of using TM which uses gdbserver. This will probably be slightly slower than the TM remote debugging since that actually uses a local gdb, but on the other hand this way you won't have to NFS or SMB mount your source code to make it available to the local debugger (and if you're on a LAN it probably won't matter anyhow).

而不是使用使用gdbserver的TM。这可能比TM远程调试略慢,因为它实际上使用本地gdb,但另一方面,您不必使用NFS或SMB安装源代码以使其可供本地调试器使用(如果你在局域网上,无论如何都无所谓。

There's also a reference TCF implementation for linux, which you may or may not have any luck recompiling for AIX, but it allows for remote debugging if gdbserver is otherwise not available:

还有一个针对linux的参考TCF实现,你可能有或没有运气重新编译AIX,但它允许远程调试,如果gdbserver不可用:

http://wiki.eclipse.org/DSDP/TM/TCF_FAQ

#3


0  

tried also to remotly debug an aix-appl with windows eclipse-cdt-gdb. Got blocked at the end with unix/windows path-problems. Maybe my result can help u a little further - maybe you already got it work. I'm interested in your comment. asked on eclipse news portal- following the answer of martin oberhuber (thanks again) tried dsp dd (also blocked with path problem) and set an request in eclipse bugzilla.

我还尝试用windows eclipse-cdt-gdb远程调试aix-appl。最后因unix / windows路径问题而被阻止。也许我的结果可以帮助你更进一步 - 也许你已经有了它的工作。我对你的评论感兴趣。在eclipse新闻门户网站上问道 - 按照martin oberhuber的回答(再次感谢)尝试了dsp dd(也阻止了路径问题)并在eclipse bugzilla中设置了一个请求。

here the link to news: http://www.eclipse.org/newsportal/article.php?id=406&group=eclipse.dsdp.tm Here my bugzilla: https://bugs.eclipse.org/bugs/show_bug.cgi?id=252758

这里有新闻链接:http://www.eclipse.org/newsportal/article.php?id = 406&group = eclipse.dsdp.tm这里我的bugzilla:https://bugs.eclipse.org/bugs/show_bug.cgi ?ID = 252758

At the moment we still debug localy with xldb but I am trying ddd-gdb at the moment. At least locally gdb is running.

目前我们仍然使用xldb调试localy,但此刻我正在尝试ddd-gdb。至少本地gdb正在运行。