RE: Re[2]: JDEbug hangs trying to debug GUI (swing) application

2002-10-16 Thread James Cox

Hi Paul.  I must admit that it's been some time since I even tried debugging
a GUI application (6 months?).  Since then, I've migrated to emacs 21.1, at
least 2 versions of jdee, and applied multiple windows updates.  

This morning, I wrote a trivial swing program and fired up the debugger.  Of
course, everthing works fine now.  (both launching and attaching to an
existing process).  Emacs no longer freezes when i hit a break point on the
event dispatch thread.  I've changed something in my environment, but I
can't be much help in telling you what.  Maybe somebody who is experiencing
the problem can incrementally upgrade and nail down where the problem is
(was).

My current environement:
MS Windows 2000 5.00.2195 Service Pack 2
Emacs 21.1.1
JDEE 2.2.9beta10
jdk 1.3.1_01


-jim







 -Original Message-
 From: Paul Kinnucan [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, October 16, 2002 12:26 AM
 To: James Cox
 Cc: [EMAIL PROTECTED]
 Subject: RE: Re[2]: JDEbug hangs trying to debug GUI (swing) 
 application
 
 
 James Cox writes:
   I too experienced the same problems that Serguei did when 
 my app hit a
   breakpoint while on the event dispatch thread.  This seems 
 to only happen on
   WIN NT/2000.  There are 2 solutions (workarounds):
   
  1.  Get off the event dispatch thread.  Good swing 
 programs don't
   tie up the event dispatch thread doing non-GUI work.  Look at Sun's
   implementation of SwingWorker for one possible solution.  
 If you're not sure
   what thread your on,  call Thread.currentThread().toString().
   
  2.  Debug remotely.  While the three debugging 
 techniques mentioned
   below don't work on the same PC, I was able to use JDEbug 
 remotely via a
   socket. See Attaching via a Socket in the JDEbug user's 
 guide.  I realize
   that not everyone has the luxury of having 2 pcs in their cube.
   
 
 This works for me, using the same computer and the same Emacs
 session. I set a breakpoint in my code, run my application, with
 jde-run-option-connect-to-debugger enabled, select JDB-External
 Process-Attach to from the Emacs menu, and then select the menu item
 or dialog box button that triggers the breakpoint in my code.
 
 - Paul
 



RE: Re[2]: JDEbug hangs trying to debug GUI (swing) application

2002-10-11 Thread James Cox

I too experienced the same problems that Serguei did when my app hit a
breakpoint while on the event dispatch thread.  This seems to only happen on
WIN NT/2000.  There are 2 solutions (workarounds):

1.  Get off the event dispatch thread.  Good swing programs don't
tie up the event dispatch thread doing non-GUI work.  Look at Sun's
implementation of SwingWorker for one possible solution.  If you're not sure
what thread your on,  call Thread.currentThread().toString().

2.  Debug remotely.  While the three debugging techniques mentioned
below don't work on the same PC, I was able to use JDEbug remotely via a
socket. See Attaching via a Socket in the JDEbug user's guide.  I realize
that not everyone has the luxury of having 2 pcs in their cube.

hope this might help someone...

Jim




 -Original Message-
 From: Serguei Khomiouk [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 11, 2002 9:05 AM
 To: Paul Kinnucan
 Cc: [EMAIL PROTECTED]
 Subject: Re[2]: JDEbug hangs trying to debug GUI (swing) application
 
 
 
 Well, my experiments show that JDEbug hungs both emacs and 
 debugee GUI application in any cases. It doesn't matter if 
 you are connecting to the application with socket, shared 
 memory (for WinNT) or launching the application directly.
 I am pretty sure that to resolve the problem it is necessary 
 to change JDEbug's code.
 
 Serguei
 
 
  
  Serguei Khomiouk writes:
Hi, Paul

Yes, you are right. 
Unfortunately emacs can't JDEbug GUI.
The single thing I don't understand is why in can't 
 debug even independently running application (say connceted 
 to JDEbug with socket).

  Paul Kinnucan writes:
  Yes, this puzzles me, too. You would think that the fact 
 that JDEBug runs
  as a separate process would avoid blocking Emacs. I need to 
 look into 
  this. I'm sure there must be a solution.
  
  Paul