From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 5556 invoked from network); 4 Feb 2000 17:11:43 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 4 Feb 2000 17:11:43 -0000 Received: from bastion.power-x.co.uk (bastion.power-x.co.uk [62.232.19.201]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id MAA09887 for ; Fri, 4 Feb 2000 12:11:42 -0500 Received: from springhead.px.uk.com (IDENT:dg@springhead.px.uk.com [172.16.18.41]) by bastion.power-x.co.uk (8.9.3/8.9.3) with ESMTP id RAA27179 for ; Fri, 4 Feb 2000 17:11:41 GMT Date: Fri, 4 Feb 2000 17:11:01 +0000 (GMT) From: "Dr. David Gilbert" X-Sender: dg@springhead.px.uk.com To: axp-list@redhat.com Subject: Re: xxgdb and C In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 4 Feb 2000, John Clayton wrote: > One problem is that xxgdb won't recognize many simple library functions, > such as printf, sqrt, and pow. It will execute these functions > correctly as long as I don't step to or break in lines that contain > these functions, but if I do step through lines with these functions > xxgdb says that the function is not defined (or something like that). Is > there a problem with where it's looking for the libraries, such as in > some configuration file? If so, how can I fix it? You can't look inside these functions normally because you don't have the source. > Another problem is that I can't get xxgdb to recognize global macro > definitions included from other files. Say I were to have the line > > #define NUMBER 3 > > in a file that is included at the head of another file. When I list a > function in the second file and request the value of anything that refers > to NUMBER, such as an array element y[NUMBER], the debugger says that > NUMBER is not in the current context. How can I fix this? Correct - NUMBER doesn't make it as far as the C compiler; the preprocessor will replace all NUMBERs by 3; so their is no way the debugger can see it. A simple answer is to stop using #define's for constants and use const's: const int Number=3; Dave /------------------------------------------------------------------\ | Dr. David Alan Gilbert | Work:dg@px.uk.com +44-161-286-2000 Ex258| | -------- G7FHJ --------|---------------------------------------- | | Home: dave@treblig.org http://www.treblig.clara.net | \------------------------------------------------------------------/