This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] namespace support
- From: Tom Tromey <tromey at redhat dot com>
- To: Sami Wagiaalla <swagiaal at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>
- Date: Fri, 05 Jun 2009 15:20:28 -0600
- Subject: Re: [PATCH 2/2] namespace support
- References: <4A16BBC7.3080608@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> writes:
Sami> Import data structure ( struct using_direct) is limited to
Sami> representing import statements where the destination is a parent
Sami> of the source (true for anonymous namespaces). This patch removes
Sami> this limitation, allowing each import to represent independent
Sami> import source and destination.
Thanks.
Aside from some nits this looks pretty good.
Is this just a "technical" patch? Or does it enable some new
user-visible functionality? The former is fine, but if it is the
latter, how about a test case?
Sami> + * dwarf2read.c (read_import_statement): Properly set import location
Sami> + and destenation.
Typo, should be "destination".
Sami> + * cp-support.h (cp_add_using, cp_add_using_directive): Now take char*
Sami> + inner, char* outer arguments. Updated callers.
I suppose these arguments ought to be renamed, now that you have
renamed the struct fields...
Sami> + char outer[outer_len+1];
We can't use VLAs in gdb. Instead, use alloca.
Also, just FYI, the GNU coding style requires spaces around that "+".
Sami> + strncpy(outer, name, outer_len);
Space before open paren.
Sami> - cp_add_using_directive (name,
Sami> - previous_component == 0
Sami> - ? 0 : previous_component - 2,
Sami> - next_component);
Sami> + cp_add_using_directive (outer, name);
Do we know for sure that NAME is \0-terminated here?
It needs to be due to the change to cp_add_using_directive.
Sami> + /* Figure out where the statement is being imported to */
Comment should be a sentence.
Sami> + /*
Sami> + Figure out what the scope of the imported die is and prepend it
Sami> + to the name of the imported die
Sami> + */
Ditto; also the formatting is wrong: no newline after the first * or
before the last *.
Sami> + if(strlen (imported_name_prefix) > 0){
Wrong brace placement.
Tom