* gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed?
@ 2005-08-22 21:08 Dave Johnson
2005-08-28 15:45 ` Daniel Jacobowitz
2006-01-16 16:09 ` Martin Michlmayr
0 siblings, 2 replies; 5+ messages in thread
From: Dave Johnson @ 2005-08-22 21:08 UTC (permalink / raw)
To: Daniel Jacobowitz, Ralf Baechle; +Cc: linux-mips
I've been trying to fix core file support for 64bit kernel with o32
userspace (working against 2.6.12 cvs tag).
After applying the patch posted on 13 Feb 2005 from Daniel Jacobowitz
to fix binfmt_elfo32.c (any reason this didn't make it into CVS?),
I still ran into trouble with gdb not understanding the NT_PRSTATUS
header in the core file.
While Dan's fix makes the kernel use elf32 definitions, gdb was still
getting confused by pr_reg contained in the core file.
Dan's definition of ELF_CORE_COPY_REGS in binfmt_elfo32.c is copying
the registers using EF_R0 as 0 not 6 producing results into offset 0
through 37 not 6 through 43 as gdb expects for 32bit core files.
Below patch (applied after Dan's patch) writes the registers at offset
6 making gdb much happier.
--
Dave Johnson
Starent Networks
=======================
Fix o32 core files under 64bit kernel to use correct register
offset in NT_PRSTATUS
Signed-off-by: Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>
===== arch/mips/kernel/binfmt_elfo32.c 1.7 vs edited =====
--- 1.7/arch/mips/kernel/binfmt_elfo32.c 2005-08-20 12:30:12 -04:00
+++ edited/arch/mips/kernel/binfmt_elfo32.c 2005-08-22 16:09:59 -04:00
@@ -51,6 +51,7 @@
#define TASK32_SIZE 0x7fff8000UL
#undef ELF_ET_DYN_BASE
#define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2)
+#define WANT_COMPAT_REG_H
#include <asm/processor.h>
#include <linux/module.h>
===== include/asm-mips/reg.h 1.1 vs edited =====
--- 1.1/include/asm-mips/reg.h 2005-02-02 11:39:14 -05:00
+++ edited/include/asm-mips/reg.h 2005-08-22 15:55:04 -04:00
@@ -70,7 +70,7 @@
#endif
-#if CONFIG_MIPS64
+#if defined(CONFIG_MIPS64) && !defined(WANT_COMPAT_REG_H)
#define EF_R0 0
#define EF_R1 1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed?
2005-08-22 21:08 gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed? Dave Johnson
@ 2005-08-28 15:45 ` Daniel Jacobowitz
2006-01-16 16:09 ` Martin Michlmayr
1 sibling, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2005-08-28 15:45 UTC (permalink / raw)
To: Dave Johnson; +Cc: Ralf Baechle, linux-mips
On Mon, Aug 22, 2005 at 05:08:20PM -0400, Dave Johnson wrote:
>
> I've been trying to fix core file support for 64bit kernel with o32
> userspace (working against 2.6.12 cvs tag).
>
> After applying the patch posted on 13 Feb 2005 from Daniel Jacobowitz
> to fix binfmt_elfo32.c (any reason this didn't make it into CVS?),
> I still ran into trouble with gdb not understanding the NT_PRSTATUS
> header in the core file.
>
> While Dan's fix makes the kernel use elf32 definitions, gdb was still
> getting confused by pr_reg contained in the core file.
>
> Dan's definition of ELF_CORE_COPY_REGS in binfmt_elfo32.c is copying
> the registers using EF_R0 as 0 not 6 producing results into offset 0
> through 37 not 6 through 43 as gdb expects for 32bit core files.
>
> Below patch (applied after Dan's patch) writes the registers at offset
> 6 making gdb much happier.
FYI, this has all been rearranged since - it did this correctly at the
time. I don't know why the patch was dropped.
--
Daniel Jacobowitz
CodeSourcery, LLC
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed?
2005-08-22 21:08 gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed? Dave Johnson
2005-08-28 15:45 ` Daniel Jacobowitz
@ 2006-01-16 16:09 ` Martin Michlmayr
2006-01-18 15:43 ` Martin Michlmayr
1 sibling, 1 reply; 5+ messages in thread
From: Martin Michlmayr @ 2006-01-16 16:09 UTC (permalink / raw)
To: Dave Johnson, Daniel Jacobowitz; +Cc: linux-mips
* Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com> [2005-08-22 17:08]:
> I've been trying to fix core file support for 64bit kernel with o32
> userspace (working against 2.6.12 cvs tag).
>
> After applying the patch posted on 13 Feb 2005 from Daniel Jacobowitz
> to fix binfmt_elfo32.c (any reason this didn't make it into CVS?),
> I still ran into trouble with gdb not understanding the NT_PRSTATUS
> header in the core file.
>
> While Dan's fix makes the kernel use elf32 definitions, gdb was still
> getting confused by pr_reg contained in the core file.
>
> Dan's definition of ELF_CORE_COPY_REGS in binfmt_elfo32.c is copying
> the registers using EF_R0 as 0 not 6 producing results into offset 0
> through 37 not 6 through 43 as gdb expects for 32bit core files.
>
> Below patch (applied after Dan's patch) writes the registers at offset
> 6 making gdb much happier.
* Daniel Jacobowitz <dan@debian.org> [2005-08-28 11:45]:
> > Below patch (applied after Dan's patch) writes the registers at offset
> > 6 making gdb much happier.
>
> FYI, this has all been rearranged since - it did this correctly at the
> time. I don't know why the patch was dropped.
Can this be applied?
> Fix o32 core files under 64bit kernel to use correct register
> offset in NT_PRSTATUS
>
> Signed-off-by: Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>
>
> ===== arch/mips/kernel/binfmt_elfo32.c 1.7 vs edited =====
> --- 1.7/arch/mips/kernel/binfmt_elfo32.c 2005-08-20 12:30:12 -04:00
> +++ edited/arch/mips/kernel/binfmt_elfo32.c 2005-08-22 16:09:59 -04:00
> @@ -51,6 +51,7 @@
> #define TASK32_SIZE 0x7fff8000UL
> #undef ELF_ET_DYN_BASE
> #define ELF_ET_DYN_BASE (TASK32_SIZE / 3 * 2)
> +#define WANT_COMPAT_REG_H
>
> #include <asm/processor.h>
> #include <linux/module.h>
> ===== include/asm-mips/reg.h 1.1 vs edited =====
> --- 1.1/include/asm-mips/reg.h 2005-02-02 11:39:14 -05:00
> +++ edited/include/asm-mips/reg.h 2005-08-22 15:55:04 -04:00
> @@ -70,7 +70,7 @@
>
> #endif
>
> -#if CONFIG_MIPS64
> +#if defined(CONFIG_MIPS64) && !defined(WANT_COMPAT_REG_H)
>
> #define EF_R0 0
> #define EF_R1 1
>
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed?
2006-01-16 16:09 ` Martin Michlmayr
@ 2006-01-18 15:43 ` Martin Michlmayr
2006-01-18 15:51 ` Ralf Baechle
0 siblings, 1 reply; 5+ messages in thread
From: Martin Michlmayr @ 2006-01-18 15:43 UTC (permalink / raw)
To: Dave Johnson, Daniel Jacobowitz; +Cc: linux-mips
* Martin Michlmayr <tbm@cyrius.com> [2006-01-16 16:09]:
> Can this be applied?
>
>
> > Fix o32 core files under 64bit kernel to use correct register
> > offset in NT_PRSTATUS
> > Signed-off-by: Dave Johnson <djohnson+linuxmips@sw.starentnetworks.com>
> >
> > -#if CONFIG_MIPS64
> > +#if defined(CONFIG_MIPS64) && !defined(WANT_COMPAT_REG_H)
Obviously, this should be CONFIG_64BIT now.
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed?
2006-01-18 15:43 ` Martin Michlmayr
@ 2006-01-18 15:51 ` Ralf Baechle
0 siblings, 0 replies; 5+ messages in thread
From: Ralf Baechle @ 2006-01-18 15:51 UTC (permalink / raw)
To: Martin Michlmayr; +Cc: Dave Johnson, Daniel Jacobowitz, linux-mips
On Wed, Jan 18, 2006 at 03:43:19PM +0000, Martin Michlmayr wrote:
> > > -#if CONFIG_MIPS64
> > > +#if defined(CONFIG_MIPS64) && !defined(WANT_COMPAT_REG_H)
>
> Obviously, this should be CONFIG_64BIT now.
That was a GDB bug so no need for kernel changes.
Ralf
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-01-18 15:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-22 21:08 gdb gets confused with o32 core files, WANT_COMPAT_REG_H needed? Dave Johnson
2005-08-28 15:45 ` Daniel Jacobowitz
2006-01-16 16:09 ` Martin Michlmayr
2006-01-18 15:43 ` Martin Michlmayr
2006-01-18 15:51 ` Ralf Baechle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox