Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Kamil Rytarowski <n54@gmx.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/5] Refactor the NetBSD amd64 gdbserver support
Date: Mon, 28 Sep 2020 17:11:01 -0400	[thread overview]
Message-ID: <e1253fde-4480-dfbb-1560-fc96535d8fff@simark.ca> (raw)
In-Reply-To: <20200923042515.28245-4-n54@gmx.com>

On 2020-09-23 12:25 a.m., Kamil Rytarowski wrote:
> Replace the pre-C++ construct of netbsd_target_ops, netbsd_regset_info
> and netbsd_tdesc with C++ inheritance approach found in the Linux
> gdbserver code. Add netbsd_amd64_target, that inherits from the
> netbsd_process_target class and add proper singleton object for
> the_netbsd_target, initialized from netbsd_amd64_target.
>
> Call low_arch_setup () on post process creation, which sets machine
> specific properties of the traced process.
>
> Remove global singleton the_netbsd_target object from the generic
> gdbserver code.
>
> This refactoring introduces no functional change from the end-user
> point of view.

I just spotted some nits, but otherwise the patch is OK.

> diff --git a/gdbserver/netbsd-amd64-low.cc b/gdbserver/netbsd-amd64-low.cc
> index 9b8ea9b8aa6..2324bdbbfea 100644
> --- a/gdbserver/netbsd-amd64-low.cc
> +++ b/gdbserver/netbsd-amd64-low.cc
> @@ -155,22 +155,9 @@ netbsd_x86_64_store_gregset (struct regcache *regcache, const char *buf)
>    netbsd_x86_64_supply_gp (AMD64_GS_REGNUM, GS);
>  }
>
> -/* Implements the netbsd_target_ops.arch_setup routine.  */
> -
> -static void
> -netbsd_x86_64_arch_setup (void)
> -{
> -  struct target_desc *tdesc
> -    = amd64_create_target_description (X86_XSTATE_SSE_MASK, false, false, false);
> -
> -  init_target_desc (tdesc, amd64_expedite_regs);
> -
> -  netbsd_tdesc = tdesc;
> -}
> -
>  /* Description of all the x86-netbsd register sets.  */
>
> -struct netbsd_regset_info netbsd_target_regsets[] =
> +const static struct netbsd_regset_info netbsd_target_regsets[] =

"const static" -> "static const", just for consistency.

> @@ -504,7 +506,7 @@ netbsd_process_target::thread_alive (ptid_t ptid)
>  void
>  netbsd_process_target::fetch_registers (struct regcache *regcache, int regno)
>  {
> -  struct netbsd_regset_info *regset = netbsd_target_regsets;
> +  const netbsd_regset_info *regset = get_regs_info();

Space before parenthesis.

>    ptid_t inferior_ptid = ptid_of (current_thread);
>
>    while (regset->size >= 0)
> @@ -525,7 +527,7 @@ netbsd_process_target::fetch_registers (struct regcache *regcache, int regno)
>  void
>  netbsd_process_target::store_registers (struct regcache *regcache, int regno)
>  {
> -  struct netbsd_regset_info *regset = netbsd_target_regsets;
> +  const netbsd_regset_info *regset = get_regs_info();

Space before parenthesis.

Simon

  reply	other threads:[~2020-09-28 21:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-23  4:25 [PATCH 0/5] Refine the NetBSD support Kamil Rytarowski
2020-09-23  4:25 ` [PATCH 1/5] Include the x86-bsd-nat.h header and fix the NetBSD/i386 build Kamil Rytarowski
2020-09-23 13:15   ` Christian Biesinger via Gdb-patches
2020-09-23 13:29     ` Kamil Rytarowski
2020-09-28 20:52       ` Simon Marchi
2020-09-23 19:46     ` John Baldwin
2020-09-23  4:25 ` [PATCH 2/5] Preinitialize the sockaddr_un variable to zero Kamil Rytarowski
2020-09-28 20:57   ` Simon Marchi
2020-09-23  4:25 ` [PATCH 3/5] Refactor the NetBSD amd64 gdbserver support Kamil Rytarowski
2020-09-28 21:11   ` Simon Marchi [this message]
2020-09-23  4:25 ` [PATCH 4/5] Add NetBSD/i386 " Kamil Rytarowski
2020-09-23  4:25 ` [PATCH 5/5] Remove the old sanity check of sigcontext offsets for NetBSD/i386 Kamil Rytarowski

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=e1253fde-4480-dfbb-1560-fc96535d8fff@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=n54@gmx.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