Lately I've realized a couple things, and I can credit (or blame) jde for
both of them:
1) how incredibly useful beanshell (bsh) is. (Kudos to Pat Niemeyer) and,
b) that I'd like to learn more about emacs lisp.
So... I started on a little elisp project. I've tried to write a function
that would start bsh AND start a debugging session at the same time. That
way, I could use bsh to test my code, and insert breakpoints on those oh so
rare moments when I encounter a bug. I figured with jde's functions
available to me, this should be easy.
The good news is that it works, almost. I've been able to launch bsh in one
window, and jdb in another. (I use java's -Xdebug option, and
jdb's -password option.) In the jdb window, I can set breakpoints. And
when I call that code via beanshell, the breakpoints are triggered. So I'm
pretty happy so far, but here's the bad news.
When I reach a breakpoint in jdb, it does not bring me to the right point in
my code's source buffer. And as I step through, I do not get the little
arrow showing me where I am. (this is a major problem)
Its been known to hang when reaching a breakpoint. I haven't figured out
exactly when this happens. I get out of this by killing the bsh buffer.
It wasn't as easy to do as I'd like. So I have some questions for Paul.
Normally, I'd prefer to suggest answers rather than merely ask questions,
but I'm really new to lisp so I just don't know. Anyway, the questions are:
Can you make it easier to add arguments (i.e. -Xdebug) to the vm when bsh is
launched? In particular when your bsh functions are called from other lisp
functions.
Also, Can you add a function to start the debugger given a hostname and a
password? This way, it would be easy for elisp programmers to write little
methods to launch there apps using java -Xdebug, and start the debugger in
another window. In the attached code you will see my attempt at such a
function, but as I mentioned earlier, it doesn't quite work.
My code is attached. Unfortunately, there is a classpath setting specific
to my machine. Search for the word 'specific' to find it; it's easy to
change. Also there are some hardwired jvm parameters that work only with
jdk 1.2.
I hope others find this useful. I'm sure it would be even more useful if
the bugs were fixed. So I'd appreciate any advice on that. I'll also take
advice on elisp in general. Thanks.
BTW, the function to call is 'dbsh'.
Peace,
-Dave
dbsh.el