* [PATCH] i386bsd-nat.c tweak
@ 2004-08-09 20:48 Mark Kettenis
2004-08-09 22:44 ` Robert Millan
0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2004-08-09 20:48 UTC (permalink / raw)
To: gdb-patches
This removes the consistency checks for really old BSDs. We don't
really support those and it hurts GNU/k*BSD.
Committed.
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i386bsd-nat.c (_initialize_i386bsd_nat): Remove `struct
sigcontext' offset consistency checks for ancient BSD.
Index: i386bsd-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/i386bsd-nat.c,v
retrieving revision 1.29
diff -u -p -r1.29 i386bsd-nat.c
--- i386bsd-nat.c 31 May 2004 11:20:41 -0000 1.29
+++ i386bsd-nat.c 9 Aug 2004 20:31:18 -0000
@@ -357,10 +357,10 @@ _initialize_i386bsd_nat (void)
#define SC_REG_OFFSET i386nbsd_sc_reg_offset
#elif defined (OpenBSD)
#define SC_REG_OFFSET i386obsd_sc_reg_offset
-#else
-#define SC_REG_OFFSET i386bsd_sc_reg_offset
#endif
+#ifdef SC_REG_OFFSET
+
/* We only check the program counter, stack pointer and frame
pointer since these members of `struct sigcontext' are essential
for providing backtraces. More checks could be added, but would
@@ -410,4 +410,6 @@ Please report this to <bug-gdb@gnu.org>.
}
SC_FP_OFFSET = offset;
+
+#endif /* SC_REG_OFFSET */
}
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] i386bsd-nat.c tweak
2004-08-09 20:48 [PATCH] i386bsd-nat.c tweak Mark Kettenis
@ 2004-08-09 22:44 ` Robert Millan
2004-08-12 8:55 ` Mark Kettenis
0 siblings, 1 reply; 4+ messages in thread
From: Robert Millan @ 2004-08-09 22:44 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On Mon, Aug 09, 2004 at 10:48:25PM +0200, Mark Kettenis wrote:
> diff -u -p -r1.29 i386bsd-nat.c
> --- i386bsd-nat.c 31 May 2004 11:20:41 -0000 1.29
> +++ i386bsd-nat.c 9 Aug 2004 20:31:18 -0000
> @@ -357,10 +357,10 @@ _initialize_i386bsd_nat (void)
> #define SC_REG_OFFSET i386nbsd_sc_reg_offset
> #elif defined (OpenBSD)
> #define SC_REG_OFFSET i386obsd_sc_reg_offset
> -#else
> -#define SC_REG_OFFSET i386bsd_sc_reg_offset
> #endif
This disables the code below on GNU/kFreeBSD, but it's still enabled in
FreeBSD 4.x or later.
Our sigcontext structure is like FreeBSD's (the code is borrowed from
machine/signal.h). My impression is that on GNU/kFreeBSD we want to define
SC_REG_OFFSET i386fbsd4_sc_reg_offset. Please let me know if I'm missing
something.
Build on GNU/kFreeBSD still works, but it might be that keeping SC_REG_OFFSET
undefined results in a weird runtime bug that will be difficult to trace, so
I'd really like to be sure this part is ok.
> +#ifdef SC_REG_OFFSET
> +
> /* We only check the program counter, stack pointer and frame
> pointer since these members of `struct sigcontext' are essential
> for providing backtraces. More checks could be added, but would
> @@ -410,4 +410,6 @@ Please report this to <bug-gdb@gnu.org>.
> }
>
> SC_FP_OFFSET = offset;
> +
> +#endif /* SC_REG_OFFSET */
> }
--
Robert Millan
(Debra and Ian) (Gnu's Not (UNiplexed Information and Computing System))/\
(kernel of *(Berkeley Software Distribution))
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i386bsd-nat.c tweak
2004-08-09 22:44 ` Robert Millan
@ 2004-08-12 8:55 ` Mark Kettenis
2004-08-12 9:39 ` Robert Millan
0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2004-08-12 8:55 UTC (permalink / raw)
To: rmh; +Cc: gdb-patches
Date: Tue, 10 Aug 2004 00:44:24 +0200
From: Robert Millan <rmh@debian.org>
On Mon, Aug 09, 2004 at 10:48:25PM +0200, Mark Kettenis wrote:
> diff -u -p -r1.29 i386bsd-nat.c
> --- i386bsd-nat.c 31 May 2004 11:20:41 -0000 1.29
> +++ i386bsd-nat.c 9 Aug 2004 20:31:18 -0000
> @@ -357,10 +357,10 @@ _initialize_i386bsd_nat (void)
> #define SC_REG_OFFSET i386nbsd_sc_reg_offset
> #elif defined (OpenBSD)
> #define SC_REG_OFFSET i386obsd_sc_reg_offset
> -#else
> -#define SC_REG_OFFSET i386bsd_sc_reg_offset
> #endif
This disables the code below on GNU/kFreeBSD, but it's still enabled in
FreeBSD 4.x or later.
Yes indeed.
Our sigcontext structure is like FreeBSD's (the code is borrowed from
machine/signal.h). My impression is that on GNU/kFreeBSD we want to define
SC_REG_OFFSET i386fbsd4_sc_reg_offset. Please let me know if I'm missing
something.
Your sigcontext structure better be identical to FreeBSD's since its
part of the kernel ABI.
Build on GNU/kFreeBSD still works, but it might be that keeping
SC_REG_OFFSET undefined results in a weird runtime bug that will be
difficult to trace, so I'd really like to be sure this part is ok.
It will be caught on normal FreeBSD.
Mark
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i386bsd-nat.c tweak
2004-08-12 8:55 ` Mark Kettenis
@ 2004-08-12 9:39 ` Robert Millan
0 siblings, 0 replies; 4+ messages in thread
From: Robert Millan @ 2004-08-12 9:39 UTC (permalink / raw)
To: Mark Kettenis; +Cc: gdb-patches
On Thu, Aug 12, 2004 at 10:55:23AM +0200, Mark Kettenis wrote:
>
> This disables the code below on GNU/kFreeBSD, but it's still enabled in
> FreeBSD 4.x or later.
>
> Yes indeed.
>
> [...]
>
> Build on GNU/kFreeBSD still works, but it might be that keeping
> SC_REG_OFFSET undefined results in a weird runtime bug that will be
> difficult to trace, so I'd really like to be sure this part is ok.
>
> It will be caught on normal FreeBSD.
We have this check:
#if defined (__FreeBSD_version) && __FreeBSD_version >= 400011
#define SC_REG_OFFSET i386fbsd4_sc_reg_offset
This ensures that SC_REG_OFFSET is defined for either 4.x or 5.x (i.e. any
non-obsolete version of FreeBSD). If not defining it triggers a bug, how
can it be caught on normal FreeBSD, if that situation never happens?
Perhaps what you want is something like this?:
#if defined (__FreeBSD_version) && __FreeBSD_version >= 400011 \
__FreeBSD_version < 500000
#define SC_REG_OFFSET i386fbsd4_sc_reg_offset
Then i386fbsd4_sc_reg_offset would be for 4.x only, which seems like the
intended result. Is that it?
--
Robert Millan
(Debra and Ian) (Gnu's Not (UNiplexed Information and Computing System))/\
(kernel of *(Berkeley Software Distribution))
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-08-12 9:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 20:48 [PATCH] i386bsd-nat.c tweak Mark Kettenis
2004-08-09 22:44 ` Robert Millan
2004-08-12 8:55 ` Mark Kettenis
2004-08-12 9:39 ` Robert Millan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox