Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Sami Wagiaalla <swagiaal@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [patch 2/2] Perform a namespace lookup at every block level
Date: Tue, 10 Nov 2009 22:52:00 -0000	[thread overview]
Message-ID: <m3ocna801w.fsf@fleche.redhat.com> (raw)
In-Reply-To: <4AE09A10.9040703@redhat.com> (Sami Wagiaalla's message of "Thu, 	22 Oct 2009 13:44:48 -0400")

>>>>> "Sami" == Sami Wagiaalla <swagiaal@redhat.com> 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> +
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;

s/;//

Sami> diff --git a/gdb/testsuite/gdb.cp/namespace-stress.exp b/gdb/testsuite/gdb.cp/namespace-stress.exp
Sami> +    return -1;

Likewise.

Tom


  reply	other threads:[~2009-11-10 22:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-10 15:10 [patch] " Sami Wagiaalla
2009-07-10 20:16 ` Daniel Jacobowitz
2009-07-13 17:55   ` Sami Wagiaalla
2009-07-23 19:46     ` Sami Wagiaalla
2009-07-23 22:19       ` Sami Wagiaalla
2009-07-29 22:12       ` Tom Tromey
2009-08-18 20:34       ` [patch 1/2] " Sami Wagiaalla
2009-10-13 19:47         ` Tom Tromey
2009-10-20 20:50           ` Sami Wagiaalla
2009-11-10 22:23             ` Tom Tromey
2009-11-10 22:26               ` Tom Tromey
2009-11-16 15:32                 ` Sami Wagiaalla
2009-11-16 19:16                   ` Sami Wagiaalla
2009-11-24 19:06                   ` Sami Wagiaalla
2009-12-21 21:44                     ` Tom Tromey
2009-08-18 20:46       ` [patch 2/2] " Sami Wagiaalla
2009-09-04 16:57         ` Sami Wagiaalla
2009-10-13 20:22           ` Tom Tromey
2009-10-22 17:47             ` Sami Wagiaalla
2009-11-10 22:52               ` Tom Tromey [this message]
2009-11-16 17:55                 ` Sami Wagiaalla
2009-11-24 19:12                   ` Sami Wagiaalla
2009-12-21 21:55                     ` Tom Tromey
2010-01-11 21:24                       ` Sami Wagiaalla
2010-01-12 17:43                         ` Tom Tromey
2010-01-14 16:47                           ` Sami Wagiaalla
2010-01-14 20:18                             ` Sami Wagiaalla
2010-01-15 18:06                               ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3ocna801w.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=swagiaal@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox