[antlr-interest] antlr3c-3.1b2 bug with setDebugListener

Jim Idle jimi at temporal-wave.com
Wed May 7 12:10:55 PDT 2008


It isn't all tested out yet I am afraid - it will be before 3.1 is released though. I haven't hit that one myself, but that doesn't mean it isn;t a bug ;-)

Jim

> -----Original Message-----
> From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-
> bounces at antlr.org] On Behalf Of Kaleb Pederson
> Sent: Wednesday, May 07, 2008 12:03 PM
> To: antlr-interest at antlr.org
> Subject: [antlr-interest] antlr3c-3.1b2 bug with setDebugListener
> 
> I'm just starting with the C runtime, so in the process of trying to
> debug my grammar, I turned on -debug which resulted in a segfault.  I
> traced it down to setDebugListener not being set on the token-stream
> pseudo-object.  I grepped through the code, and it looks like there's
> a static function that the function pointer should be set to.
> 
> My gdb transcript follows:
> 
> (gdb) break src/antlr3parser.c:134
> No source file named src/antlr3parser.c.
> Make breakpoint pending on future shared library load? (y or [n]) y
> Breakpoint 1 (src/antlr3parser.c:134) pending.
> (gdb) run
> Starting program: ./main preface.txt
> 
> Breakpoint 1, setDebugListener (parser=0x80698a8, dbg=0x8069a60) at
> src/antlr3parser.c:134
> 134                     parser->tstream->setDebugListener(parser-
> >tstream, dbg);
> (gdb) step
> 
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000 in ?? ()
> 
> (gdb) up
> #1  0xb7f89853 in setDebugListener (parser=0x80698a8, dbg=0x8069a60)
> at src/antlr3parser.c:134
> 134                     parser->tstream->setDebugListener(parser-
> >tstream, dbg);
> (gdb) print parser->tstream
> $1 = (pANTLR3_TOKEN_STREAM) 0x8069730
> (gdb) print parser->tstream->setDebugListener
> $2 = (void (*)(struct ANTLR3_TOKEN_STREAM_struct *,
> pANTLR3_DEBUG_EVENT_LISTENER)) 0
> 
> Any suggestions for a workaround or did I just miss a step somewhere?
> 
> Thanks.
> 
> --Kaleb





More information about the antlr-interest mailing list