This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add support for imported declaration and correct search order
- From: Tom Tromey <tromey at redhat dot com>
- To: Sami Wagiaalla <swagiaal at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 03 Mar 2010 15:00:15 -0700
- Subject: Re: [patch] Add support for imported declaration and correct search order
- References: <4B86DA17.5040200@redhat.com> <20100225224145.GA21231@host0.dyn.jankratochvil.net> <m3y6ifn4fo.fsf@fleche.redhat.com> <4B8ED7C2.6030804@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> writes:
Sami> 2010-03-03 Sami Wagiaalla <swagiaal@redhat.com>
Sami> PR c++/7936:
Getting close...
Sami> +cp_add_using_directive (const char *dest,
Sami> + const char *src,
Sami> + const char *alias,
Sami> + const char *declaration,
Sami> struct obstack *obstack)
[...]
Sami> + if (declaration != NULL)
Sami> + new->declaration = savestring (declaration, strlen (declaration));
obsavestring
Does the duplicate exclusion logic here need to be updated to account
for the new field?
Sami> @@ -3448,23 +3448,32 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
Sami> + canonical_name = (char *) imported_name_prefix;
I don't think you should need to cast away const in this function.
There is some other way to make it work, like having a non-const
temporary hold the result of alloca.
Sami> + else
Sami> + {
Sami> + canonical_name = alloca (strlen (imported_name) + 1);
Sami> + strcpy (canonical_name, imported_name);
Sami> + }
I think this is a pointless copy, just do canonical_name = imported_name.
thanks,
Tom