2009/01/15

Just a note: How to debug java in eclipse and c/c++ in vc at the same time?

 

 

 

1. start eclipse and vc.
2. add break points in eclipse and vc.
3. package java program and depoly to vc working directory.
4. ensure that java program can startup in command line at vc working directory.
5. set vc active configuration to debug
6. set vc debug information in project settings
    (1) Executable for debug session: full path for java.exe
    (2) Program arguments: -Xdebug -Xrunjdwp:transport=dt_socket,address=[port],server=y,suspend=n -classpath [classpath] [main class] [parameters]
7. set eclipse debug information in Run->Debug Configurations
    (1) create a configuration in "Remote Java Application"
    (2) Connection Type: Standard (Socket Attach)
    (3) Connection Properties: Host: localhost, Port: [port] (the same as step 6.(2))
8. press F5 to start vc debug
9. when console shows "Listening for transport dt_socket at dress: [port]", start eclipse debug created on step 7.
10. now we can debug java & native code at the same time.