From: "Dr. David Gilbert" <gilbertd@treblig.org>
To: axp-list@redhat.com
Subject: Re: xxgdb and C
Date: Fri, 4 Feb 2000 17:11:01 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.10.10002041709000.19306-100000@springhead.px.uk.com> (raw)
In-Reply-To: <Pine.SOL.3.92.1000204102528.1876B-100000@osiris>
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 |
\------------------------------------------------------------------/
prev parent reply other threads:[~2000-02-04 17:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-04 13:41 AXP KICKSTART Succeeded Kevin Wood
2000-02-04 15:42 ` xxgdb and C John Clayton
2000-02-04 17:11 ` Dr. David Gilbert [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox