This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: PATCH: fix crashes in partial-stab.h for BP programs
- To: Greg McGary <greg at mcgary dot org>
- Subject: Re: PATCH: fix crashes in partial-stab.h for BP programs
- From: Michael Snyder <msnyder at redhat dot com>
- Date: Fri, 04 Aug 2000 15:02:58 -0700
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Red Hat, Inc.
- References: <200008042153.OAA22500@kayak.mcgary.org>
I think these are good. Unles there's a reason why
we should take more drastic action (issue a warning
or bail) on a null pointer, let's check them in.
Michael
Greg McGary wrote:
>
> Programs built with bounded pointers
> (see http://gcc.gnu.org/projects/bp/main.html)
> cause indigestion for gdb because these code paths
> are exercised with pst==NULL.
>
> I don't claim to understand anything about this code, or the
> implications of pst==NULL, but I do notice that many other places in
> this file guard uses of pst with a check for NULL.
>
> Greg
>
> Index: gdb/partial-stab.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/partial-stab.h,v
> retrieving revision 1.3
> diff -u -p -r1.3 partial-stab.h
> --- partial-stab.h 2000/05/04 16:52:33 1.3
> +++ partial-stab.h 2000/08/04 19:42:04
> @@ -401,7 +401,7 @@ switch (CUR_SYMBOL_TYPE)
> function relative stabs, or the address of the function's
> end for old style stabs. */
> valu = CUR_SYMBOL_VALUE + last_function_start;
> - if (pst->texthigh == 0 || valu > pst->texthigh)
> + if (pst && (pst->texthigh == 0 || valu > pst->texthigh))
> pst->texthigh = valu;
> break;
> }
> @@ -647,7 +647,7 @@ switch (CUR_SYMBOL_TYPE)
> use the address of this function as the low bound for
> the partial symbol table. */
> if (textlow_not_set
> - || (CUR_SYMBOL_VALUE < pst->textlow
> + || (pst && CUR_SYMBOL_VALUE < pst->textlow
> && CUR_SYMBOL_VALUE
> != ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))))
> {