how to debug yacc file using gdb (Lin Wei)
Sat, 31 Dec 1994 05:19:14 GMT

          From comp.compilers

Related articles
how to debug yacc file using gdb (1994-12-31)
Re: how to debug yacc file using gdb (1995-01-04)
Re: how to debug yacc file using gdb (1995-01-06)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (Lin Wei)
Keywords: yacc, debug, question, comment
Organization: National University of Singapore
Date: Sat, 31 Dec 1994 05:19:14 GMT


I am using lex & yacc to build a compiler for a mini-pascal with parallel
extension. I found yacc a nice tool, however it was clumsy to debug using gdb. As you know, without -l option, I can debug my parser.y
using gdb. But in this way, it seems impossible to print/display yacc's
attribute variables like $$ and $1 because they are considered as history
variables by gdb. I have tried \$\$ and something like that, but I
failed. Do you have any idea that I can debug .y file in gdb and also I
can view $$'s value.

Thanks in advance and Happy New Year!

Wei LIN (Research Scholar) Dept of Information Systems and Computer Science
Email: Faculty of Science
Tel: (65)772-6837 National University of Singapore
Fax: (65)779-4580 Lower Kent Ridge Road
Office: S15 02-12 Singapore 0511
[In most Unix versions of yacc, $$ is stored in yyval. But that's a hack,
it would indeed be nice to arrange for preprecessors like yacc and lex and
debuggers to communicate. -John]

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.