help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AW: Segmentation Fault in yyparse() method


From: Jonas Stahl
Subject: AW: Segmentation Fault in yyparse() method
Date: Wed, 14 Nov 2007 19:12:05 +0100

Ok, first thanks for the replies. I already debugged it with gdb before
writing to the mailing list. Cause I'm not very used to debugging C Code it
didn't help me very much. 

The result of debugging in short:

The debugger jumps from main() to yyparse() and the error occurs at the
first time the code gets to this code passage (after about 10 steps in
yyparse). 


In the running version without "segmentation fault", which was compiled with
gcc 3.3.6

33117     if (yychar == YYEMPTY)
(gdb) 
33120         yychar = YYLEX;
(gdb) 

Breakpoint 1, yylex () at lex.yy.c:4500
4500            if ( !(yy_init) )

As you see the debugger gets to the breakpoint at the first line of yylex().
The few variables around, yychar, YYEMPTY and yy_init have the same value in
both versions.


In the version with segmentation fault (gcc 4.1.2):

33117     if (yychar == YYEMPTY)
(gdb) 
33120         yychar = YYLEX;
(gdb) 

Program received signal SIGSEGV, Segmentation fault.
yyparse () at fullParser.tab.c:33120
33120         yychar = YYLEX;


I don't get why it doesn't get to the breakpoint. Are there any
instructions, that are performed, that the debugger doesn't show? 

Debugging just lex.yy.c runs through without a "segmentation fault".

Jonas Stahl





reply via email to

[Prev in Thread] Current Thread [Next in Thread]