Oct. 17th, 2021

jbanana: Badly drawn banana (Default)
Java's no-frills debugger, jdb, takes debugging input from stdin. But if you're debugging something that gets user input from stdin, it won't ever get any input. So you start the thing you're debugging in another window, telling it to wait for the debugger, then attach the debugger. The incantation for this is verbose and I always have to look it up, so here it is to help me next time.
cmd /c start java -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=y SomeJavaClass
jdb -connect com.sun.jdi.SocketAttach:hostname=localhost,port=5005
I also have a regular set of stuff to put in jdb.ini to make jdb less painful.
stop at SomeJavaClass:57
exclude java.*,javax.*,sun.*,com.sun.*,junit.*,jdk.*
run
monitor locals
monitor list

May 2025

M T W T F S S
   1234
5678 91011
12131415161718
19202122232425
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 14th, 2025 03:57 am
Powered by Dreamwidth Studios