Hi Andy,

JDEbug is based on Sun's Java Platform Debug Architecture (JPDA). The
initial version of the Java side of JDEbug was developed for the JDE by the
team at Sun who developed JPDA. In particular, Sun approached me two years
ago about creating a JPDA-based debugger for the JDE and offered to do the
Java side. I agreed and they then hired a summer intern to do the Java
implementation. The summer intern basically adapted the JPDA-based version
of jdb to work with the JDE. So you can see that there is a very close
connection between JDEbug and jdb. You should also be aware that both jdb
and JDEbug (and JPDA-based commercial debuggers) are basically wrappers
around JPDA. JPDA does most of the back-end work of implemening debug
commands, like detecting breakpoints, etc. Thus, bugs in JPDA can cripple
JDEbug and can be very hard for me to diagnose, let alone work around.

It does not surprise me that JPDA may be sensitive to subtle differences in
the various incarnations of Windows, especially in the area of sockets and
threading. Windows threading and socket handling is pretty messy from what
I understand. I've also had indications that the JPDA is very sensitive to
hidden differences among the various Windows operating systems. For
example, one JDEbug user could not get JDEbug to stop at breakpoints on a
laptop running Windows 2000. He tried everything including reinstalling
Windows 2000. The second time he installed Windows 2000, he omitted
installing Service Pack 1 and, lo and behold,. JDEbug started working. He
then tried JDEbug again with SP1 installed and not installed and confirmed
that JDEbug worked without but not with SP1. So  it seems that JPDA may
have dependencies on Windows features that are peculiar to particular
versions, perhaps the versions used by the JDPA team for development and
testing.

Regarding your data points, please note that the JDE launches JDEbug
directly as a subprocess of Emacs. Therefore, I cannot see that cygwin
would have anything do do with the problems you are having. Regarding the
multiple prompts, I am not sure what is causing them but I wonder if this
has anything to do with input echoing. I believe shells, including Emacs'
comint buffer, can be configured to echo command prompts.

Finally, I'd appreciate it if you would try JDEbug on the system on which
jdb worked.

- Paul


At 09:34 AM 4/5/01 -0400, you wrote:
>Paul,
>
>Here's a few more data points that might help explain what is going on. 
>I tried this last night on another system I have at home that runs NT4.0
>and an older version of Cygwin.  Everything worked fine on that system. 
>And I noticed that the JDB output did not have any repeated debugger
>prompts like I am seeing on the Windows 2000 system.
>
>I tried running jdb in both a Cygwin window and a DOS window on the
>Windows 2000 system and I'm seeing the extra debugger prompts on both
>windows.
>
>If I had to guess I'd say there seems to be something about the
>threading in JDB that's not working correctly with Windows 2000, but I
>have to say I find it hard to believe SUN wouldn't catch this.  I don't
>know if this could also affect the JPDA stuff to cause the problems I'm
>seeing with JDEbug.
>
>What do you think?  I assume you have some connections with the Java
>developers at SUN - perhaps we should run this by them?
>
>Andy
>
>Andy Bennett wrote:
>> 
>> >
>> > Have you tried running jdb from  a DOS command prompt?
>> >
>> 
>> Paul,
>> 
>> I gave this a try and for the most part, everything appears to work just
>> fine.  There was one very peculiar thing about the output that I noticed
>> which could be what is causing problems for the jdb.
>> 
>> I am including the output from the debugger session below.
>> 
>> What I noticed is that sometimes when I step I get an "extra" debugger
>> prompt "main[1]" included in the output from the debugger and sometimes
>> I don't.  I really can't quite figure out when it happens or what is
>> causing it to do this.  However, if the jdb is either expecting or not
>> expecting this behavior then I could see where it might get confused
>> trying to process the output from the jdb.
>> 
>> I'm not sure how this relates to the JDEbug problems I am seeing, but it
>> sure seems like it could be causing the erratic behavior in the jdb.
>> 
>> Let me know what you think...
>> 
>> Andy
>> 
>> java> jdb -classpath c:/work/jdetest/java/debug/ -tclassic
>> -Djava.compiler=NONE
>>  jdetest.Test
>> Initializing jdb...
>> > stop in jdetest.Test.main
>> Deferring breakpoint jdetest.Test.main.
>> It will be set after the class is loaded.
>> > run
>> run jdetest.Test
>> >
>> VM Started: Set deferred breakpoint jdetest.Test.main
>> 
>> Breakpoint hit: thread="main", jdetest.Test.main(), line=16, bci=0
>>   16     Test t = new Test();
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.main(), line=17, bci=8
>>   17     t.run (args);
>> 
>> main[1] step
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=23, bci=0
>>   23       String testString = "This is a test";
>> 
>> main[1] next
>> 
>> Step completed: main[1] thread="main", jdetest.Test.run(), line=24,
>> bci=3
>>   24       int idx = testString.indexOf ("test");
>> 
>> main[1] next
>> 
>> Step completed: main[1] thread="main", jdetest.Test.run(), line=25,
>> bci=10
>>   25       idx = testString.indexOf ("est");
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=26, bci=17
>>   26       idx = testString.indexOf ("st");
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=27, bci=24
>>   27       idx = testString.indexOf ("This");
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=28, bci=31
>>   28       idx = testString.indexOf ("his");
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=29, bci=38
>>   29       idx = testString.indexOf ("is");
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=30, bci=45
>>   30       idx = testString.indexOf ("is is");
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=31, bci=52
>>   31       idx = testString.indexOf ("is a");
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=32, bci=59
>>   32       for (int i = 0; i < testString.length(); i++) {
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=33, bci=65
>>   33         idx += 1;
>> 
>> main[1] next
>> 
>> Step completed: main[1] thread="main", jdetest.Test.run(), line=32,
>> bci=68
>>   32       for (int i = 0; i < testString.length(); i++) {
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=33, bci=65
>>   33         idx += 1;
>> 
>> main[1] next
>> main[1]
>> Step completed: thread="main", jdetest.Test.run(), line=32, bci=68
>>   32       for (int i = 0; i < testString.length(); i++) {

Reply via email to