|
JDB referenceDebugging with JDBWhile usually you will be able to simply run JDB by typing 'jdb' at the prompt, in some cases you will be debugging an application which uses STDIN and STDOUT and things will suddenly become not so simple. After you've spend hours bashing your head with the keyboard in frustration, you will realise what you really should have done was set up two xterms and then do this: Start up your applicationjava -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=4571 HelloWorld Connect to it through JDBjdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=4571 Where address and port obviously correspond to each other... and HelloWorld is the nameof the class to test. My useless list of useful commandsSince I'm sick and tired of forgetting how to use JDB, the somewhat distant and slightly backward cousin of GDB, I have decided to conjure up this small reference. I've already forgotten what those commands actually do, but I recall that these were the most useful. It is a lot easier to look up the commands in the help file individually than read the whole bloody thing everytime I decide to use jdb. This is obviously of little use to anyone but me, but I hope society accepts this humble gift of mine. I'm not really gonna put much effort into this, so don't complain if the layout is a bit dodgy.
Click here to go back to the main page and remember to never, ever come here again... for your own benefit. This document was last updated on: 00:08 7/04/08 |