At 09:44 AM 5/13/99 +1000, David Cohen wrote:
>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)
>

The reason that you don't get a cursor is that you commented out all the
essential code required to allow Emacs to track the location of the current
breakpoint!! The JDE extracts breakpoint locations from the debugger's
output, using the filter functions you've commented out.

>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.
>

I'd have to look into this.

>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.
>

Yes. 

>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.
>

Yes. I actually do something like this to enable applet debugging. You
might want to take a look at it. The code is in jde-db.el.

That being said, I think an easier approach at bsh/debugger integration
might be to launch the debugger from within the BeanShell. At least that is
the approach I have planned on taking. However, at this point, I am
reluctant to undertake any serious work on the debugger until we get a
replacement for jdb that is geared to working with the JDE. As you may be
aware, Sun itself has volunteered to assist me in creating such a debugger,
to the point of even offering to hire a summer intern to adapt Sun's new
version of jdb to work with the JDE.

- Paul

 

Reply via email to