jQuery in Action, 2nd edition*
The moose likes Java in General and the fly likes attach source code to the remote debug Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "attach source code to the remote debug" Watch "attach source code to the remote debug" New topic
Author

attach source code to the remote debug

xeon costa
Greenhorn

Joined: May 10, 2011
Posts: 15

Hi,

I'm running a java application in a remote site, and I would like to debug the application. I'm using jdb, and, due to network architecture, I can only use jdb do debug in text-mode.

To debug in text-mode I use the command:
jdb -attach remotesite:port.

At this point this is ok. Now I would like to attach the source code to the jdb. I tried the command
jdb -attach remotesite:port ~/src/org/path/file.java

to attach the source code to the remote debug to. But it doesn't work.

In jdb, I try the command
use ~/src/org/path/file.java

but it doesn't work either.

How can I attach the source code to the remote debug?

Thanks,
PSC


Thanks,
Paul Santa Maria
Ranch Hand

Joined: Feb 24, 2004
Posts: 236
I hate to say it, but I honestly think your best bet is to set up your environment so that you can use something like vncserver to debug locally.

At a minimum, you might need to copy your source locally. At which point you should be able to use jdb "-sourcepath xyz:abc:123".

ANYWAY:
Some of these links might help:

* http://download.oracle.com/javase/1.4.2/docs/tooldocs/windows/jdb.html

* http://jdee.sourceforge.net/jdedoc/html/jdb-ug/jdb-ug.html

* http://download.oracle.com/javase/1.4.2/docs/guide/jpda/


Paul M. Santa Maria, SCJP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: attach source code to the remote debug