This is the mail archive of the
mailing list for the GDB project.
Re: [patch 2/2] Perform a namespace lookup at every block level
- 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: Tue, 10 Nov 2009 15:52:43 -0700
- Subject: Re: [patch 2/2] Perform a namespace lookup at every block level
- References: <4A57512A.email@example.com> <20090710194949.GA2064@caradoc.them.org> <4A5B68A4.firstname.lastname@example.org> <4A68B91D.email@example.com> <4A8B0FD9.firstname.lastname@example.org> <4AA14648.email@example.com> <firstname.lastname@example.org> <4AE09A10.email@example.com>
- Reply-to: tromey at redhat dot com
>>>>> "Sami" == Sami Wagiaalla <firstname.lastname@example.org> writes:
Sami> + directive_match = search_parents
Sami> + ? strncmp (scope, current->import_dest,
Sami> + strlen(current->import_dest)) == 0
Sami> + : strcmp (scope, current->import_dest) == 0;
In the GNU style a multi-line expression like this has to be surrounded
by parens. Put one before 'search_parents' and then another before ';'.
Also this is missing a space after 'strlen'.
Sami> + /* Mark this import as searched so that the recursive call does not
Sami> + search it again. */
Sami> + current->searched = 1;
Sami> + sym = cp_lookup_symbol_namespace (current->import_src,
Sami> + name,
Sami> + linkage_name,
Sami> + block,
Sami> + domain,
Sami> + 0);
Sami> + current->searched = 0;
If cp_lookup_symbol_namespace can throw an exception, then it can leave
the wrong setting of 'searched' here.
I don't know whether cp_lookup_symbol_namespace can in fact throw, but I
tend to assume that most things in GDB can and defensively use cleanups.
Do the new tests include a case which exercises this?
Sami> diff --git a/gdb/testsuite/gdb.cp/namespace-recursive.exp b/gdb/testsuite/gdb.cp/namespace-recursive.exp
Sami> + return -1;
Sami> diff --git a/gdb/testsuite/gdb.cp/namespace-stress.exp b/gdb/testsuite/gdb.cp/namespace-stress.exp
Sami> + return -1;