From: Kamil Rytarowski <n54@gmx.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Implement nbsd_nat_target::thread_name
Date: Wed, 1 Apr 2020 22:17:02 +0200 [thread overview]
Message-ID: <01e11821-bab3-9ae1-ce96-aef249066a45@gmx.com> (raw)
In-Reply-To: <87imij0zv6.fsf@tromey.com>
On 01.04.2020 21:28, Tom Tromey wrote:
>>>>>> "Kamil" == Kamil Rytarowski <n54@gmx.com> writes:
>
> Kamil> Return the name assigned to a thread by an application. Return
> Kamil> the string in a static buffer.
>
> Thanks for the patch.
>
> Kamil> + if (sysctl (mib, 5, NULL, &size, NULL, 0) == -1 || size == 0)
> Kamil> + perror_with_name (("sysctl"));
>
> I suspect it's better to return NULL there than to throw an exception.
>
> Kamil> + if (kl == NULL)
> Kamil> + perror_with_name (("calloc"));
> Kamil> +
> Kamil> + if (sysctl (mib, 5, kl.get (), &size, NULL, 0) == -1 || size == 0)
> Kamil> + perror_with_name (("sysctl"));
>
> Likewise in these cases.
>
> thanks,
> Tom
>
Please check a newer patch:
[PATCH v2] Implement basic threading support in the NetBSD target
https://sourceware.org/pipermail/gdb-patches/2020-March/167018.html
Does this comment still apply to return NULL for thread_name()
thread_alive() and update_thread_list()?
In practice the kernel will almost never return error when used
properly, unless there is specified a wrong process id or similar. It's
generally safe to abort on error here.
next prev parent reply other threads:[~2020-04-01 20:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 18:35 Kamil Rytarowski
2020-04-01 19:28 ` Tom Tromey
2020-04-01 20:17 ` Kamil Rytarowski [this message]
2020-04-01 20:45 ` 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=01e11821-bab3-9ae1-ce96-aef249066a45@gmx.com \
--to=n54@gmx.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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