This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: (patch) hpjyg21: FAT_FREE_PSYMTABS
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: Re: (patch) hpjyg21: FAT_FREE_PSYMTABS
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Fri, 12 Nov 1999 10:10:14 +1100
- CC: Jimmy Guo <guo at cup dot hp dot com>
- Organization: Cygnus Solutions
- References: <Pine.LNX.4.10.9911111247400.5596-100000@hpcll168.cup.hp.com>
Maintainers,
I've another meta maintainer question on this :-)
Is it better to use #ifdef or have the compiler eliminate optional
code? For instance:
if (FAT_FREE_PSYMTABS)
{
}
If the compiler does the elimination (instead of CPP) the code is always
being checked and hence less likely to suffer bit rot.
Yes I know it's something of a radical departure from the existing
conventions.
Andrew
> + #ifdef FAT_FREE_PSYMTABS
> +
> + /* srikanth, in the case of the Wildebeest, the psymtabs could be empty
> + and hence the call to find_pc_sect_psymbol() could fail to find anything.
> + Due potentially to a combination of bugs in compilers, linkers, loaders,
> + editors and debugger engineers :-), sometimes there is an overlap of
> + textlow and texthigh values between and multiple psymtabs. As a result,
> + if we are handed an address equal to the texthigh or textlow, we could
> + end up identifying the wrong psymtab.
> +
> + To be absolutely sure of the identity of the psymtab, let us verify that
> + the one we narrow down on, also houses pc + 4.
> + */
> +
> + if (p == NULL)
> + {
> + CORE_ADDR pc_plus4 = pc + 4;
> + if (pc_plus4 >= tpst->textlow &&
> + pc_plus4 <= tpst->texthigh)
> + return tpst;
> + }
> + #endif