From: Pedro Alves <palves@redhat.com>
To: Philippe Waroquiers <philippe.waroquiers@skynet.be>,
gdb-patches@sourceware.org
Subject: Re: [RFA] Fix leak by using td_ta_delete() to deregister target process and deallocate internal process handle.
Date: Sat, 08 Dec 2018 15:54:00 -0000 [thread overview]
Message-ID: <22f21481-7efa-2836-235b-d2d803f26220@redhat.com> (raw)
In-Reply-To: <20181207203410.29636-1-philippe.waroquiers@skynet.be>
On 12/07/2018 08:34 PM, Philippe Waroquiers wrote:
>
> +static const char *thread_db_err_str (td_err_e err);
> +
> /* When PID has exited or has been detached, we no longer want to keep
> track of it as using libpthread. Call this function to discard
> thread_db related info related to PID. Note that this closes
> @@ -273,6 +276,17 @@ delete_thread_db_info (int pid)
> if (info == NULL)
> return;
>
> + if (info->thread_agent != NULL && info->td_ta_delete_p != NULL)
> + {
> + td_err_e err;
> +
> + err = info->td_ta_delete_p (info->thread_agent);
You can declare and initialize in the same line/statement.
> + if (err != TD_OK)
> + warning (_("Cannot deregister target process: %s"),
> + thread_db_err_str (err));
Should mention libthread_db here, otherwise I think this
warning may appear mystifying. Maybe mention the PID as well,
in case we're debugging more than one process? Like:
warning (_("Cannot deregister process %d from libthread_db: %s"),
pid, thread_db_err_str (err));
Otherwise looks fine. Please push. Thanks!
Pedro Alves
next prev parent reply other threads:[~2018-12-08 15:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-07 20:34 Philippe Waroquiers
2018-12-08 15:54 ` Pedro Alves [this message]
2018-12-08 16:22 ` Philippe Waroquiers
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=22f21481-7efa-2836-235b-d2d803f26220@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=philippe.waroquiers@skynet.be \
/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