From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26661 invoked by alias); 4 Dec 2001 19:59:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 26563 invoked from network); 4 Dec 2001 19:58:59 -0000 Received: from unknown (HELO mail.wrs.com) (147.11.1.11) by sources.redhat.com with SMTP; 4 Dec 2001 19:58:59 -0000 Received: from kankakee.wrs.com (kankakee [147.11.37.13]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id LAA22981; Tue, 4 Dec 2001 11:58:08 -0800 (PST) From: mike stump Received: (from mrs@localhost) by kankakee.wrs.com (8.9.3+Sun/8.9.0) id LAA06265; Tue, 4 Dec 2001 11:58:54 -0800 (PST) Date: Tue, 04 Dec 2001 11:59:00 -0000 Message-Id: <200112041958.LAA06265@kankakee.wrs.com> To: danishsamad@yahoo.com, gcc@gcc.gnu.org Subject: Re: problems debugging gcc X-SW-Source: 2001-12/txt/msg00151.txt.bz2 > Date: Tue, 4 Dec 2001 01:21:29 -0800 (PST) > From: Danish Samad > To: gcc@gcc.gnu.org > I am facing some problems debugging gcc. Whenever I try to step into > the function yyparse(), in the toplevel.c file, it steps into > bison.simple instead of c-parse.c. Although there is a portion in > bison.simple which says that the action file gets copied here but > while debugging this portion it says file out of range. Any > solution to this problem? Yes. Step through bison.simple a couple hundred times, and you'll discover that most of the time, it spends it's time in about two to four places you care about. One place, is dispatching to actions. It can be felt, by noticing the line (at least in bison 1.25): switch (yyn) { and the fact that when you step it, it will be at a line in your parse.y file. If you set a break point on that line, with the command step 1, you will discover that you always wind up stopped inside an action, and that you always stop for all actions. This is very handy. The next thing that is handy, is to have compiled with -DYYDEBUG=1 and set yydebug to 1, and then set a break point on the lines like (again, these are from bison 1.25, your mileage may vary): #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate); #endif #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif fprintf (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); depending upon what you want to see. Feel free to contribute this to the bison manual, if it helps you. About the out of range stuff, best to just ignore it, step until you get someplace you want to be.