We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
开发者_StackOverflowClosed 7 years ago.
Improve this questionThe current setup is that I'm developing a program for Linux (and debugging the binary with GDB via SSH), but using Eclipse and a remote file mount to do the editing from a Windows box. I'd really love to be able to debug in eclipse but I haven't yet found anything that would work.
Anyone know of anything I should look at?
BTW: I'm willing to use non eclipse tool but can't afford to buy anything.
From http://community.livejournal.com/shlomif_tech/9932.html:
- Install CDT - The Eclipse C/C++ Development Tooling.
- Set up a C/C++ project so it will build and compile.
- Install gdb and gdbserver. The latter does not seem to be available in any Mandriva package and had to be compiled from the gdb source, where it is built by default.
- Run gdbserver on the generated executable using a command like gdbserver localhost:10900 ./my-exe
- In Eclipse go to Run → "Open Run Dialog...", and go to the upper debugger tab and select gdbserver Debugger in the Debugger drop-down. Afterwards, go to the "Connection" tab under Debugger Options and configure your connection. For my demonstration I've chosen "Type: TCP" "Host: localhost" and "Port number: 10900".
- Select the Run → Debug in Eclipse option and start debugging the application.
Using Eclipse (assuming Java) this works great. Just start the program on the linux box with the following options:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=3000
Then, in Eclipse, click the down arrow by the bug(debugger) and select debug configurations. Create a new Remote Java Application, and add in the name of the linux box and the port you are using (3000 from above). Once the app is launched, it will wait for you to connect. Simply Click Debug or select the Debug Configuration from the drop down debug menu. Change suspend to 'n' if you don't want it to wait.
精彩评论