[antlr-interest] Remote Debug C Target parser

Guillaume Hoffmann guillaumh at gmail.com
Fri Sep 17 00:31:41 PDT 2010


Hi Jim,

any update on this issue?

I have attempted to fix that by hand by taking the archive
http://www.antlr.org/download//C/libantlr3c-3.3-SNAPSHOT.tar.gz and
replacing the file ./src/antlr3debughandlers.c by the version present
in the git repository of Antlr on github (which has differences in the
sprintf format strings), and with that I could at least have a
beginning of debugging working with antlrworks. But after a few steps
antlrworks fails with this exception:

$ java -jar antlrworks-1.4.jar
java.lang.NullPointerException
java.lang.NullPointerException
	at org.antlr.runtime.debug.RemoteDebugEventSocketListener.unEscapeNewlines(RemoteDebugEventSocketListener.java:515)
	at org.antlr.runtime.debug.RemoteDebugEventSocketListener.deserializeToken(RemoteDebugEventSocketListener.java:453)
	at org.antlr.runtime.debug.RemoteDebugEventSocketListener.dispatch(RemoteDebugEventSocketListener.java:301)
	at org.antlr.runtime.debug.RemoteDebugEventSocketListener.eventHandler(RemoteDebugEventSocketListener.java:176)
	at org.antlr.runtime.debug.RemoteDebugEventSocketListener.run(RemoteDebugEventSocketListener.java:472)
	at java.lang.Thread.run(Thread.java:636)

This happens with the latest stable antlrworks  jarfile available on
the website.

regards,

Guillaume


2010/9/9 Jim Idle <jimi at temporal-wave.com>:
> I'll try to do that this weekend.
>
> Jim
>
>> -----Original Message-----
>> From: Guillaume Hoffmann [mailto:guillaumh at gmail.com]
>> Sent: Thursday, September 09, 2010 1:29 PM
>> To: Andi Clemens
>> Cc: Jim Idle; antlr-interest at antlr.org
>> Subject: Re: [antlr-interest] Remote Debug C Target parser
>>
>> I have the same problem than Andi.
>>
>> Would it be possible that someone updated of the files:
>>
>> http://www.antlr.org/download//antlr-master-3.2.1-SNAPSHOT-
>> completejar.jar
>> http://www.antlr.org/download//C/libantlr3c-3.3-SNAPSHOT.tar.gz
>>
>> so that it would be easy to get an unstable version of ANTLR where
>> debugging with C target works?
>>
>> regards,
>>
>> Guillaume
>>
>> On Thu, Sep 9, 2010 at 4:13 PM, Andi Clemens <Andi.Clemens at gmx.net>
>> wrote:
>> > ok, thanks for the tipp!
>> >
>> > Andi
>> >
>> > -------- Original-Nachricht --------
>> >> Datum: Thu, 9 Sep 2010 07:11:21 -0700
>> >> Von: "Jim Idle" <jimi at temporal-wave.com>
>> >> An: antlr-interest at antlr.org
>> >> Betreff: Re: [antlr-interest] Remote Debug C Target parser
>> >
>> >> You are better using the native debugger at that release point. I
>> >> think that ANTLRWorks and the C runtime got out of sync. The current
>> >> development branch is working if you want to use that, but it isn't
>> >> tested very much of course.
>> >>
>> >> Jim
>> >>
>> >> > -----Original Message-----
>> >> > From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
>> >> > bounces at antlr.org] On Behalf Of Andi Clemens
>> >> > Sent: Thursday, September 09, 2010 3:31 AM
>> >> > To: antlr-interest at antlr.org
>> >> > Subject: [antlr-interest] Remote Debug C Target parser
>> >> >
>> >> > Hi,
>> >> >
>> >> > I try to debug a Parser written for the C-Target.
>> >> > Since I can not debug it in ANTLworks directly, I wrote a small
>> >> > test app
>> >> that
>> >> > includes the parser and parses one line:
>> >> >
>> >> > http://pastebin.com/WzXrvTxr
>> >> >
>> >> > The parser and lexer have been compiled with the "-debug" option.
>> >> > I can connect to the port in ANTLworks, but as soon as I click
>> >> > "step
>> >> forward"
>> >> > in the debugger, my program finishes and the debugger doesn't
>> >> > display anything.
>> >> >
>> >> > This is the console output I get:
>> >> >
>> >> > [...]
>> >> > unknown debug event: location 796 5 unknown debug event: enterRule
>> >> > PLSQL3c.g select_expression unknown debug event: exitSubRule 153
>> >> > unknown debug event: location 646 5 unknown debug event: enterRule
>> >> > PLSQL3c.g select_statement unknown debug event: location 640 5
>> >> > unknown debug event: enterRule PLSQL3c.g select_command unknown
>> >> > debug event: location 583 5 unknown debug
>> >> > event: enterRule PLSQL3c.g to_modify_data unknown debug event:
>> >> > location
>> >> > 574 5 unknown debug event: enterRule PLSQL3c.g sql_command unknown
>> >> > debug event: location 569 5 unknown debug event: enterRule
>> >> > PLSQL3c.g sql_statement unknown debug event: location 147 5 unknown
>> debug event:
>> >> > enterRule PLSQL3c.g statement unknown debug event: location 126 14
>> >> > unknown debug event: enterSubRule 20 unknown debug event:
>> >> > enterDecision 20 unknown debug event: LT 1 9 4 0 1 22 "; unknown
>> >> > debug
>> >> > event: LT 2 0 -1 0 1 -1 "<EOF> unknown debug event: exitDecision 20
>> >> > unknown debug event: exitSubRule 20 unknown debug event: location
>> >> > 126
>> >> > 32 unknown debug event: enterSubRule 21 unknown debug event:
>> >> > enterDecision 21 unknown debug event: LT 1 9 4 0 1 22 "; unknown
>> >> > debug
>> >> > event: exitDecision 21 unknown debug event: enterAlt 1 unknown
>> >> > debug
>> >> > event: location 126 32 unknown debug event: LT 1 9 4 0 1 22 ";
>> >> > unknown debug event: consumeToken 9 4 0 1 22 "; unknown debug
>> event:
>> >> > exitSubRule 21 unknown debug event: location 126 38 unknown debug
>> >> > event: LT 1 0 -1 0 1 -1 "<EOF> unknown debug event: consumeToken 0
>> >> > -1 0
>> >> 1
>> >> > -1 "<EOF> unknown debug event: location 127 2 unknown debug event:
>> >> > enterRule PLSQL3c.g parse_statements
>> >> > java.net.SocketException: Connection reset
>> >> > java.net.SocketException: Connection reset
>> >> >         at
>> >> > java.net.SocketInputStream.read(SocketInputStream.java:168)
>> >> >         at
>> >> > sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
>> >> >         at
>> >> > sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
>> >> >         at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
>> >> >         at
>> >> > java.io.InputStreamReader.read(InputStreamReader.java:167)
>> >> >         at java.io.BufferedReader.fill(BufferedReader.java:136)
>> >> >         at java.io.BufferedReader.readLine(BufferedReader.java:299)
>> >> >         at java.io.BufferedReader.readLine(BufferedReader.java:362)
>> >> >         at
>> >> > org.antlr.runtime.debug.RemoteDebugEventSocketListener.eventHandler
>> >> > (R
>> >> > emoteDebugEventSocketListener.java:178)
>> >> >         at
>> >> > org.antlr.runtime.debug.RemoteDebugEventSocketListener.run(RemoteDe
>> >> > b
>> >> > u
>> >> > gEventSocketListener.java:472)
>> >> >         at java.lang.Thread.run(Thread.java:619)
>> >> >
>> >> >
>> >> > What am I doing wrong?
>> >> >
>> >> > Andi
>> >> >
>> >> > --
>> >> > Achtung Sicherheitswarnung: GMX warnt vor Phishing-Attacken!
>> >> > http://portal.gmx.net/de/go/sicherheitspaket
>> >> >
>> >> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> >> > Unsubscribe:
>> >> > http://www.antlr.org/mailman/options/antlr-interest/your-
>> >> > email-address
>> >>
>> >>
>> >> List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> >> Unsubscribe:
>> >> http://www.antlr.org/mailman/options/antlr-interest/your-email-addres
>> >> s
>> >
>> > --
>> > Achtung Sicherheitswarnung: GMX warnt vor Phishing-Attacken!
>> > http://portal.gmx.net/de/go/sicherheitspaket
>> >
>> > List: http://www.antlr.org/mailman/listinfo/antlr-interest
>> > Unsubscribe:
>> > http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>> >
>
>
> 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