Skip to content

Instantly share code, notes, and snippets.

@peschwa
Last active April 30, 2016 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peschwa/d61db7a81c253790d48c0894ee45bc65 to your computer and use it in GitHub Desktop.
Save peschwa/d61db7a81c253790d48c0894ee45bc65 to your computer and use it in GitHub Desktop.
# code being debugged
$ ./perl6-jdb-server -e'use nqp; A: for 1 { nqp::debugnoop(1); last A };'
# jdb stuff:
main[1] print tc.handlers
tc.handlers = "[]"
main[1] dump tc.curFrame.caller.codeRef.staticInfo.handlers
tc.curFrame.caller.codeRef.staticInfo.handlers = {
instance of long[4] (id=1911), instance of long[4] (id=1912), instance of long[5] (id=1913)
}
main[1] dump tc.curFrame.caller.codeRef.staticInfo.handlers[0]
tc.curFrame.caller.codeRef.staticInfo.handlers[0] = {
340, 0, 16, 1
}
main[1] dump tc.curFrame.caller.codeRef.staticInfo.handlers[1]
tc.curFrame.caller.codeRef.staticInfo.handlers[1] = {
341, 340, 12, 1
}
main[1] dump tc.curFrame.caller.codeRef.staticInfo.handlers[2]
tc.curFrame.caller.codeRef.staticInfo.handlers[2] = {
342, 341, 28, 2, 10
}
# code being debugged
$ ./perl6-jdb-server -e'use nqp; A: for 1 { for 1 { nqp::debugnoop(1); last A } };'
# jdb stuff
main[1] dump tc.curFrame.caller.codeRef.staticInfo.handlers[0]
tc.curFrame.caller.codeRef.staticInfo.handlers[0] = {
340, 0, 16, 1
}
main[1] dump tc.curFrame.caller.codeRef.staticInfo.handlers[1]
tc.curFrame.caller.codeRef.staticInfo.handlers[1] = {
341, 340, 12, 1
}
main[1] dump tc.curFrame.caller.codeRef.staticInfo.handlers[2]
tc.curFrame.caller.codeRef.staticInfo.handlers[2] = {
342, 341, 28, 2, 10
}
main[1] dump tc.curFrame.caller.caller.codeRef.staticInfo.handlers[2]
java.lang.IndexOutOfBoundsException: Invalid array index: 2
tc.curFrame.caller.caller.codeRef.staticInfo.handlers[2] = null
main[1] dump tc.curFrame.caller.caller.codeRef.staticInfo.handlers[0]
java.lang.IndexOutOfBoundsException: Invalid array range: 0 to 0
tc.curFrame.caller.caller.codeRef.staticInfo.handlers[0] = null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment