This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: kgdb support for gdb: patch 1
- From: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- To: amitkale at linsyssoft dot com
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 21 Oct 2004 19:22:04 +0200 (CEST)
- Subject: Re: kgdb support for gdb: patch 1
- References: <200410211821.08680.amitkale@linsyssoft.com>
From: "Amit S. Kale" <amitkale@linsyssoft.com>
Date: Thu, 21 Oct 2004 18:21:08 +0530
Hi,
I haven't added any support for detecting kernel osabi
automatically. Detecting it with present kernel binary structure
is rather shaky. It's safer to let users run the command "set osabi
Linux-kernel".
Fair enough. Indeed it seems that vmlinux is a fairly standard static
ELF executable.
I'll be later sending more patches.
Please review it and let me know if it's ok for inclusion in gdb.
Of course it isn't, since this can't compile ;-). You seem to be in
limbo betwen LINUXKERNEL and LINUX_KERNEL. Please choose the variant
*with* the underscore.
Anyway, I think for the kernel you shouldn't use the Linux register
cache layout, bur rather the normal register layout. The Linux
register cache includes the "orig_eax" pseudo register that is
implemented by the kernel. My guess is that the kernel itself doesn't
have it. I'm not completely sure though, but unless you can motivate
why you do need "orig_eax" please remove these lines:
+ set_gdbarch_num_regs (gdbarch, I386_LINUX_NUM_REGS);
+ set_gdbarch_register_name (gdbarch, i386_linux_register_name);
+ set_gdbarch_register_reggroup_p (gdbarch, i386_linux_register_reggroup_p);
These lines will need adjustments too:
+ tdep->gregset_reg_offset = i386_linux_gregset_reg_offset;
+ tdep->gregset_num_regs = ARRAY_SIZE (i386_linux_gregset_reg_offset);
+ tdep->sizeof_gregset = 17 * 4;
Setting tdep->gregset_num_regs to I386_NUM_GREGS should be OK.
Apart from that, you'll also need to provide a ChangeLog.
Can you post an update patch?
Cheers,
Mark