This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] stabsread.c: Fix for `ptype class Static' stabs FAIL
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: "Peter.Schauer" <Peter dot Schauer at regent dot e-technik dot tu-muenchen dot de>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 7 Mar 2002 17:50:12 -0500
- Subject: Re: [RFA] stabsread.c: Fix for `ptype class Static' stabs FAIL
- References: <200202271919.UAA08441@reisser.regent.e-technik.tu-muenchen.de>
Peter.Schauer writes:
> The patch below fixes the `ptype class Static' stabs FAIL from classes.exp.
>
> Ok to commit ?
>
If it only affects c++ (and it looks like it does) and if DanielJ says
Ok, it's fine with me.
Elena
> * stabsread.c (read_member_functions): Fix is_stub test for
> static member functions, improve comment.
>
> --- ./stabsread.c.orig Sat Feb 23 12:17:26 2002
> +++ ./stabsread.c Wed Feb 27 20:08:37 2002
> @@ -3287,13 +3287,27 @@ read_member_functions (struct field_info
> }
> case '?':
> /* static member function. */
> - new_sublist->fn_field.voffset = VOFFSET_STATIC;
> - if (strncmp (new_sublist->fn_field.physname,
> - main_fn_name, strlen (main_fn_name)))
> - {
> - new_sublist->fn_field.is_stub = 1;
> - }
> - break;
> + {
> + int slen = strlen (main_fn_name);
> +
> + new_sublist->fn_field.voffset = VOFFSET_STATIC;
> +
> + /* For static member functions, we can't tell if they
> + are stubbed, as they are put out as functions, and not as
> + methods.
> + GCC emits the fully mangled name if
> + dbxout.c:flag_minimal_debug is not set, so we have to
> + detect a fully mangled physname here and set is_stub
> + accordingly. */
> + if (!(strncmp (new_sublist->fn_field.physname,
> + main_fn_name, slen) == 0
> + && new_sublist->fn_field.physname[slen] == '_'
> + && new_sublist->fn_field.physname[slen + 1] == '_'))
> + {
> + new_sublist->fn_field.is_stub = 1;
> + }
> + break;
> + }
>
> default:
> /* error */
>
> --
> Peter Schauer pes@regent.e-technik.tu-muenchen.de