This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [commit] Fix OpenBSD/i386 and OpenBSD/amd64 kernel trapframe unwinders
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 22 Dec 2005 09:20:13 -0500
- Subject: Re: [commit] Fix OpenBSD/i386 and OpenBSD/amd64 kernel trapframe unwinders
- References: <200512221409.jBME9L7W005129@elgar.sibelius.xs4all.nl>
On Thu, Dec 22, 2005 at 03:09:21PM +0100, Mark Kettenis wrote:
> +
> + find_pc_partial_function (func, &name, NULL, NULL);
> + if (name && strncmp(name, "Xintr", 5) == 0)
> + addr = sp + 8; /* It's an interrupt frame. */
> + else
> + addr = sp;
> +
Is this series of patches really a good idea?
I realize there's no way to configure GDB at runtime to do this sort of
thing, and I accept that that's a serious shortcoming that we
eventually need to fix. But you're adding bits to the OpenBSD target
that only make sense in terms of the naming conventions of a single
OpenBSD program (which happens to be the kernel); I've resisted doing
this in the past both for The Server Then Known As XFree86 and for the
Linux kernel. Why should GDB know the names of functions in a single
one of the infinitely many things it might be debugging?
On a less metaphysical note, I'd worry about any other program with a
function named Xintr.
On a nitpicking note, you missed a space before a parenthesis above :-)
--
Daniel Jacobowitz
CodeSourcery, LLC