Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: "gdb-patches@sourceware.org ml" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Stop leaking extra_string
Date: Thu, 21 Mar 2013 00:42:00 -0000	[thread overview]
Message-ID: <514A358F.3080403@redhat.com> (raw)
In-Reply-To: <514A0A9E.1090105@redhat.com>

On 03/20/2013 12:14 PM, Pedro Alves wrote:

> When we get to this bit in addr_string_to_sals (called through
> breakpoint_re_set_default):
>
> 	  if (cond_string)
> 	    b->cond_string = cond_string;
> 	  b->thread = thread;
> 	  b->task = task;
> 	  if (extra_string)
> 	    b->extra_string = extra_string;
> 	  b->condition_not_parsed = 0;
>
> Is b->extra_string always NULL here, or could we be
> leaking it here too?

I don't think that is possible right now.

When extra_string is set by find_condition_and_thread, 
init_breakpoint_sal (called from ops->create_breakpoints_sal) will error 
if extra_string isn't NULL (for non-dprintf breakpoints).

So the only way to get extra_string != NULL in breakpoint_re_set is by 
setting a pending dprintf breakpoint, which doesn't even work because 
any pending breakpoint will automatically have extra_string set to NULL 
in create_breakpoint.

But this is all largely academic for two reasons: 1) Adding an xfree 
there wouldn't hurt; 2) I'm going to submit a patch to do just that 
because I am changing it so that extra_string could be set. :-)

I've committed my original patch. Thank you for taking a look at this.

Keith


  reply	other threads:[~2013-03-20 22:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20 19:14 Keith Seitz
2013-03-20 19:23 ` Pedro Alves
2013-03-21  0:42   ` Keith Seitz [this message]
2013-03-22 20:13     ` Pedro Alves

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=514A358F.3080403@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@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