Visual studio + remote gdb debugging

纵饮孤独 提交于 2020-01-13 09:52:33

问题


What is best way to do remote live gdb debugging and use Visual studio as the front end.

In my case: I have a C++ application (compiled for debugging) running on a Linux server

  1. Can I use Visual studio on my windows machine as a front end to do live debugging on the C++ application. Is this even possible for a large scale application (OR)
  2. If above is not possible, can I use eclipse on my windows or on a different linux box to do the same remote live debugging
  3. Any other better IDE options ?

Thanks.


回答1:


You can easily do it with VisualGDB:

  1. Build your app on the Linux machine and ensure that you can run it.
  2. Install VisualGDB on your Windows machine with Visual Studio.
  3. Run the VisualGDB build server on the Linux machine.
  4. In Visual Studio, create new project, select C++->VisualGDB
  5. In the wizard select Linux Application -> Import Existing -> Import from Remote machine
  6. Select the directory where you have built the Linux app. If it's not based on GNU Make, also specify the build command line.
  7. Specify whether you want to synchronize IntelliSense directories with Visual Studio.
  8. On the last wizard page specify the executable name of your project so that VisualGDB knows what to debug.

When you press "finish", the Wizard will create a Visual Studio wrapper project around your Linux project so that you can edit the files, built the project and debug it from Visual Studio.

There's a more detailed tutorial here: http://visualgdb.com/tutorials/linux/import/




回答2:


You can try WinGDB.

It is an extension for Visual Studio allowing to develop and debug programs with GDB. Here is how to setup Remote Linux development using WinGDB.




回答3:


I don't think it's possible using Visual Studio.

It should be possible using gdbserver/gdb combo, but on Windows machine you will need special build of gdb that targets linux. I never tried this, but it should be possible to build. If you can get this working, then you can use Eclipse or any IDE that supports GNU tools.




回答4:


Just some recommendation:
You can install a free X server on your Windows machine, such as Xming or Xorg in Cygwin. Then you can do Linux native debugging with eclipse. Just display the eclipse GUI to your X server on Windows. You can interactive with the GUI on your Windows machine.




回答5:


Now possible with VS2015 + GDB extension, reas MS blog post here: http://blogs.msdn.com/b/vcblog/archive/2015/11/18/announcing-the-vs-gdb-debugger-extension.aspx



来源:https://stackoverflow.com/questions/10145222/visual-studio-remote-gdb-debugging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!