Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFA 4/4 take 2] Improved linker-debugger interface
Date: Tue, 14 Aug 2012 19:49:00 -0000	[thread overview]
Message-ID: <87r4r9xnih.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20120731121253.GB4756@redhat.com> (Gary Benson's message of	"Tue, 31 Jul 2012 13:12:53 +0100")

>>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:

Gary> 2012-07-30  Gary Benson  <gbenson@redhat.com>
Gary> 	* breakpoint.h (handle_solib_event): Moved function definition
Gary> 	to solib.h, and added a new parameter.
[...]

Gary> +static void
Gary> +free_probes (struct svr4_info *info)
Gary> +{
Gary> +  int i;
Gary> +
Gary> +  for (i = 0; i < NUM_PROBES; i++)
Gary> +    VEC_free (probe_p, info->probes[i]);
Gary> +
Gary> +  memset (info->probes, 0, sizeof (info->probes));

VEC_free sets the pointer to NULL, so this memset isn't needed.

Gary> +  val = evaluate_probe_argument (pi->probe, 0);
Gary> +  if (val == NULL)
Gary> +    goto error;

I don't see evaluate_probe_argument in the tree.
Maybe it was in another patch of yours?

Anyway, can it really return NULL?
I would expect it to throw an exception instead.

If it does throw an exception, and since the error case needs some work,
I think you will have to use cleanups here instead.

Gary> +/* Helper function for namespace_table_flatten.  */
Gary> +
Gary> +static int
Gary> +namespace_table_flatten_helper (void **slot, void *arg)
Gary> +{
Gary> +  struct namespace *ns = (struct namespace *) *slot;
Gary> +  struct so_list *src = ns->solist;
Gary> +  struct so_list **link = (struct so_list **) arg;
Gary> +
Gary> +  while (*link)
Gary> +    link = &(*link)->next;

I think this means we iterate over the entire linked list each time we
visit some element in the hash table.

It would not take much more effort to avoid this repeated iteration, by
changing 'arg' to an object that also holds the link pointer at the tail
of the list.

Tom


  reply	other threads:[~2012-08-14 19:49 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-19 11:09 Gary Benson
2012-07-25 19:36 ` Tom Tromey
2012-07-31 12:12   ` Gary Benson
2012-07-31 12:13     ` Gary Benson
2012-08-14 19:49       ` Tom Tromey [this message]
2012-08-15 17:24 ` Jan Kratochvil
2012-08-15 17:46   ` Jan Kratochvil
2012-08-16 11:14     ` Gary Benson
2012-08-16 15:52     ` Gary Benson
2012-08-17 10:54       ` Gary Benson
2012-08-17 16:41         ` Jan Kratochvil
2012-09-19  9:49   ` Gary Benson
2012-09-19 11:14     ` Jan Kratochvil
2012-09-19 15:06       ` Gary Benson
2012-09-19 15:13         ` Jan Kratochvil
2012-09-21 12:36           ` Gary Benson
2012-09-21 14:46             ` Jan Kratochvil
2012-09-28 10:51               ` Gary Benson
2012-09-28 10:58                 ` Jan Kratochvil

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=87r4r9xnih.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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