[antlr-interest] "Cannot launch the debugger"

Edwards, Waverly Waverly.Edwards at genesys.com
Tue Jun 2 06:27:06 PDT 2009


Very likely a reboot is all that was necessary.
I **often** encountered this issue if there was a failure in 
the interpreter to launch because of an issue with user 
defined code. I recall having reported this back in August 
2007 but I do not recall getting a response as to who this 
issue should be directed to.

I don't know if you are getting the same dialog that I did
which is:

 "Cannot launch the debugger. 
Time-out waiting to connect to the remote parser."

The real problem appears to be a failure to launch and a
subsequent blocking of the port.  Changing classpath had
no bearing on the solution, the reboot enabled everything
to work as expected, just as it did for me.  Whenever I had
a failure to launch I had two choices, fix my code and change
the port the debugger was communicating on or fix my code and
reboot.


W.

Original message below entitled "[antlr-interest] ANTLR BUG"
24 August 2007.

-----------------------------


I don't know if this is an ANTLR or an Antlrworks bug 1.1.2 

I am using Antlrworks  1.1.2  and get the following message 
when debugging the below grammar. 



"Cannot launch the debugger. 
Time-out waiting to connect to the remote parser." 



I Googled the error and found out that if there is something 
wrong with the grammar or the code block that you can get 
this message.  I've had times where something incorrect 
about my Java usage in the action code block and received 
this alert.  Ok, I'm not happy about it but I've accepted that 
Antlrworks doesn't tell me where the problem is, it just tosses 
up this dialog which isn't very helpful.  I would consider this a 
bug BUT here is the real BUG. 



BUG ALERT: 
The below code is valid.  I have tested the action code block 
using the NetBeans IDE a number of times.  I just replace 
getText() with a valid string.  The following two lines seem to 
be offensive. 

if ( txt.charAt(0) == quoteChr ) txt.deleteCharAt(0); 
if ( txt.charAt( lastCharPos ) == quoteChr ) txt.deleteCharAt( lastCharPos ); 

If either or both of these lines are commented out the debugger works. 
If both of these lines are uncommented the debugger fails, giving the 
"Cannot launch the debugger." message.  Separately they pose no 
threat but together they generate a failure.  It would seem that Antlrworks 
is to blame but I don't know this since I don't know how the underlying 
architecture works, as the problem may really be ANTLR which is why 
I entitled the message "ANTLR BUG" 

Thank you for your time, 




W. 

Interesting that "Google" or "Googling" is a verb. 




grammar  QUOTETEST; 



prog    :       start+ ; 

start   :       (ID | INTEGER | DBLQUOTE | SYMBOL | NEWLINE ) 
        ; 
        
NEWLINE :       '\r'? '\n'; 
WS      :       (' ' | '\t' | '\n' | '\r') {$channel=HIDDEN;} 
        ; 
ID      :       Letter (Letter | Digit)* 
        ; 
INTEGER 
        :       Digit (Digit)* 
        ; 
SYMBOL  :       ('+' | '-' | '=')* 
        ; 
        
fragment 
Letter  :       'a'..'z' | 'A'..'Z' 
        ; 
fragment        
Digit   :       '0'..'9' 
        ; 



DBLQUOTE 
   :  '"' 
      (~'"' | '""')* 
      '"' 
          { 
                
                int where, lastCharPos; 
                String quote, dblDblQuote, cont; 
                StringBuffer txt; 
                char quoteChr = 34; 

                cont = "¬\r\n"; // window continuation 
                //cont = "¬\r" // mac continuation 
                //cont = "¬\n" // unix continuation 
                dblDblQuote = "\"\""; 
                quote = "\n"; 
                txt = new StringBuffer(getText()); 
                lastCharPos = txt.length( )-1; 
        
        // Remove first and last double-quote 
                if ( txt.charAt(0) == quoteChr ) txt.deleteCharAt(0); 
       //       if ( txt.charAt( lastCharPos ) == quoteChr ) txt.deleteCharAt( lastCharPos ); 
                System.out.println( txt.toString() );      
          } 
          ; 

<<quotedText.txt>> 


-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Matthew Rawlings
Sent: Monday, June 01, 2009 9:27 PM
To: antlr-interest at antlr.org
Subject: Re: [antlr-interest] "Cannot launch the debugger"

Thanks to the clues, I got it working in the end. 

The changes made were:
1. Strip out every PATH and CLASSPATH entries that may clash, and then
reboot. It took a fair few reboots.
2. Switch back to port 49153.
3. Uninstall the old JDKs to prevent them being picked up.


> -----Original Message-----
> From: Terence Parr [mailto:parrt at cs.usfca.edu]
> Sent: 02 June 2009 01:02
> To: Matthew Rawlings
> Cc: antlr-interest at antlr.org
> Subject: Re: [antlr-interest] "Cannot launch the debugger"
> 
> 3.1.2 or 3.1.1 had a different port I think. Make sure you run
> ANTLRWorks with the ANTLR that comes in its jar or make sure use the
> latest of those tools. somewhere there is a mismatch :)
> Ter



List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address


More information about the antlr-interest mailing list