diff options
author | Kamil Rytarowski <n54@gmx.com> | 2020-09-23 05:54:19 +0200 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2020-10-02 00:44:47 +0200 |
commit | 6ff330351e7741774c4b7ac1214cf7d73c7eac4d (patch) | |
tree | fb5dd884a9a72643c1a70946b7447c0102407d51 /gdb | |
parent | 8b667faedf6012048f1f6e71785b1ac1412b8a9c (diff) | |
download | gdb-6ff330351e7741774c4b7ac1214cf7d73c7eac4d.zip gdb-6ff330351e7741774c4b7ac1214cf7d73c7eac4d.tar.gz gdb-6ff330351e7741774c4b7ac1214cf7d73c7eac4d.tar.bz2 |
Remove the old sanity check of sigcontext offsets for NetBSD/i386
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.
* i386-nbsd-tdep.c (i386nbsd_sc_reg_offset): Now static.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/i386-bsd-nat.c | 6 | ||||
-rw-r--r-- | gdb/i386-nbsd-tdep.c | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 71aab70..33e5df7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-10-01 Kamil Rytarowski <n54@gmx.com> + * i386-bsd-nat.c (_initialize_i386bsd_nat): Update. + * i386-nbsd-tdep.c (i386nbsd_sc_reg_offset): Now static. + +2020-10-01 Kamil Rytarowski <n54@gmx.com> + * i386-bsd-nat.c: Include "x86-bsd-nat.h". 2020-09-30 Tom de Vries <tdevries@suse.de> diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c index 4e86932..12b45ef 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) { diff --git a/gdb/i386-nbsd-tdep.c b/gdb/i386-nbsd-tdep.c index f350412..82772b4 100644 --- a/gdb/i386-nbsd-tdep.c +++ b/gdb/i386-nbsd-tdep.c @@ -55,7 +55,7 @@ static int i386nbsd_r_reg_offset[] = }; /* From <machine/signal.h>. */ -int i386nbsd_sc_reg_offset[] = +static int i386nbsd_sc_reg_offset[] = { 10 * 4, /* %eax */ 9 * 4, /* %ecx */ |