Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kamil Rytarowski <n54@gmx.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/5] Remove the old sanity check of sigcontext offsets for NetBSD/i386
Date: Wed, 23 Sep 2020 06:25:15 +0200	[thread overview]
Message-ID: <20200923042515.28245-6-n54@gmx.com> (raw)
In-Reply-To: <20200923042515.28245-1-n54@gmx.com>

NetBSD switched to ucontext, back in 2003 and the sigcontext code
is no longer available for users, except for legacy compat layers.

This code was not available anyway as the pre-processor check
was probably never operational and buildable on NetBSD. The code
inside it does not compile.

Meanwhile, move the offset variable into the ifdef goards and avoid
the error about unused variable.

../../gdb/i386-bsd-nat.c: In function 'void _initialize_i386bsd_nat()':
../../gdb/i386-bsd-nat.c:347:7: error: unused variable 'offset' [-Werror=unused-variable]
  347 |   int offset;
      |       ^~~~~~
cc1plus: all warnings being treated as errors

gdb/ChangeLog:

	* i386-bsd-nat.c (_initialize_i386bsd_nat): Update.
---
 gdb/ChangeLog      | 4 ++++
 gdb/i386-bsd-nat.c | 6 +-----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c95e681b4a8..716df36fdd2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2020-09-23  Kamil Rytarowski  <n54@gmx.com>
+
+	* i386-bsd-nat.c (_initialize_i386bsd_nat): Update.
+
 2020-09-23  Kamil Rytarowski  <n54@gmx.com>

 	* i386-nbsd-nat.c: Include "x86-bsd-nat.h".
diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c
index 4e8693246c8..12b45efb465 100644
--- a/gdb/i386-bsd-nat.c
+++ b/gdb/i386-bsd-nat.c
@@ -344,8 +344,6 @@ void _initialize_i386bsd_nat ();
 void
 _initialize_i386bsd_nat ()
 {
-  int offset;
-
   /* To support the recognition of signal handlers, i386-bsd-tdep.c
      hardcodes some constants.  Inclusion of this file means that we
      are compiling a native debugger, which means that we can use the
@@ -356,8 +354,6 @@ _initialize_i386bsd_nat ()
 #define SC_REG_OFFSET i386fbsd4_sc_reg_offset
 #elif defined (__FreeBSD_version) && __FreeBSD_version >= 300005
 #define SC_REG_OFFSET i386fbsd_sc_reg_offset
-#elif defined (NetBSD) || defined (__NetBSD_Version__)
-#define SC_REG_OFFSET i386nbsd_sc_reg_offset
 #elif defined (OpenBSD)
 #define SC_REG_OFFSET i386obsd_sc_reg_offset
 #endif
@@ -376,7 +372,7 @@ _initialize_i386bsd_nat ()

   /* Override the default value for the offset of the program counter
      in the sigcontext structure.  */
-  offset = offsetof (struct sigcontext, sc_pc);
+  int offset = offsetof (struct sigcontext, sc_pc);

   if (SC_PC_OFFSET != offset)
     {
--
2.28.0


      parent reply	other threads:[~2020-09-23  4:26 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
2020-09-23  4:25 ` [PATCH 4/5] Add NetBSD/i386 " Kamil Rytarowski
2020-09-23  4:25 ` Kamil Rytarowski [this message]

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=20200923042515.28245-6-n54@gmx.com \
    --to=n54@gmx.com \
    --cc=gdb-patches@sourceware.org \
    /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