jbanana: Badly drawn banana (Default)
[personal profile] jbanana
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

February 2026

M T W T F S S
      1
2345678
9101112131415
16 171819202122
232425262728 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated May. 22nd, 2026 10:56 pm
Powered by Dreamwidth Studios