This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Debugging the GCC compiler proper 'cc1'
- To: "Mahadev K Cholachagudda" <kcmahadev at zilogindia dot com>
- Subject: Re: Debugging the GCC compiler proper 'cc1'
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 19 Jan 2001 13:24:29 -0200
- Cc: "Gcc-Help at Gcc dot Gnu dot Org" <gcc-help at gcc dot gnu dot org>, "Crossgcc-Help" <crossgcc at sources dot redhat dot com>
- Organization: GCC Team, Red Hat
- References: <NEBBJIKLHKODECFJDDFGAEKMCDAA.kcmahadev@zilogindia.com>
On Jan 19, 2001, "Mahadev K Cholachagudda" <kcmahadev@zilogindia.com> wrote:
> (gdb) b yyparse
> Breakpoint 2 at 0x16aaf4: file /opt/gnu/share/bison.simple, line 225.
> As can be seen from the above description,
> when breakpoint is set in yyparse()
> it is neither set at c-parse.y file nor in the
> corresponding bison generated file c-parse.c
> It is getting set at location bison.simple.
> What is the reason for this behaviour and
> Are we missing something here.
The reason is that bison's output includes the `bison.simple' file
preceded by a `#line' directive, so that the debugger knows where the
file came from. In my case, it looks like this:
#line 3 "/n/gnu/bison-1.28/share/bison.simple"
/* This file comes from bison-1.28. */
...
> How to debug the gcc code as it passes
> through the various reductions in the LALR
> parser genrated by the bison?
I suggest adding some debugging options to the invocation of bison.
Single-stepping through bison's parsing engine is probably not a good
idea.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me