This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Make linux_ptrace_attach_fail_reason return an std::string
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 17 Jan 2018 12:26:29 +0000
- Subject: Re: [PATCH 2/2] Make linux_ptrace_attach_fail_reason return an std::string
- Authentication-results: sourceware.org; auth=none
- References: <1514732385-5506-1-git-send-email-simon.marchi@ericsson.com> <1514732385-5506-2-git-send-email-simon.marchi@ericsson.com>
On 12/31/2017 02:59 PM, Simon Marchi wrote:
> This patch makes linux_ptrace_attach_fail_reason and
> linux_ptrace_attach_fail_reason_string return std::string. It also
> replaces usages of struct buffer with std::string. This allows getting
> rid of a cleanup in in linux_ptrace_attach_fail_reason_string and
> simplifies the code in general.
>
> Something that looks odd to me is that in
> linux_ptrace_attach_fail_reason, if the two messages are appended, there
> is no separate space or \n, so the result won't be very nice. I left it
> as-is for now though.
>
> gdb/ChangeLog:
>
> * nat/linux-ptrace.h (linux_ptrace_attach_fail_reason): Return
> std::string.
> (linux_ptrace_attach_fail_reason_string): Likewise.
> * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason):
> Likewise.
> (linux_ptrace_attach_fail_reason_string): Likewise.
> * linux-nat.c (attach_proc_task_lwp_callback): Adjust.
>
> gdb/gdbserver/ChangeLog:
>
> * linux-low.c (attach_proc_task_lwp_callback): Adjust to
> linux_ptrace_attach_fail_reason_string now returning an
> std::string.
> (linux_attach): Likewise.
> * thread-db.c (attach_thread): Likewise.
LGTM.
Thanks,
Pedro Alves