From: Girish Shilamkar <girish@linsyssoft.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>,
Richard Earnshaw <rearnsha@arm.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Read arm core files
Date: Fri, 24 Feb 2006 14:01:00 -0000 [thread overview]
Message-ID: <1140781305.3228.13.camel@krypton> (raw)
In-Reply-To: <200602151155.k1FBtPsV003683@elgar.sibelius.xs4all.nl>
[-- Attachment #1: Type: text/plain, Size: 222 bytes --]
Hi,
Thank you very much, Mark Kettenis and Richard Earnshaw, for your
suggestions. I have modified the patch as per your instructions. Please
let me know if there are more changes to be done.
Regards,
-Girish Shilamkar.
[-- Attachment #2: arm-core.patch --]
[-- Type: text/x-patch, Size: 4294 bytes --]
2006-02-24 Girish Shilamkar <girish@linsyssoft.com>
* arm-linux-tdep.c (arm_linux_supply_gregset): Supply general purpose
register set to register cache.
(arm_linux_supply_fpregset): Supply floating-point register set to
register cache.
(arm_linux_regset_from_core_section): Return the appropriate register
set for the core section.
* config/arm/linux.mt: Add corelow.o.
Index: cvs-6.4/gdb/arm-linux-tdep.c
===================================================================
--- cvs-6.4.orig/gdb/arm-linux-tdep.c 2006-02-24 03:22:21.000000000 -0500
+++ cvs-6.4/gdb/arm-linux-tdep.c 2006-02-24 05:51:21.819726224 -0500
@@ -33,6 +33,7 @@
#include "osabi.h"
#include "trad-frame.h"
#include "tramp-frame.h"
+#include "regset.h"
#include "arm-tdep.h"
#include "glibc-tdep.h"
@@ -230,6 +231,18 @@
#define ARM_SET_R7_RT_SIGRETURN 0xe3a070ad
#define ARM_EABI_SYSCALL 0xef000000
+/* The following enums are used to implement the core file support. */
+enum {
+ ARM_ELF_NGREG = 18,
+ ARM_ELF_NFPREG = 33,
+ ARM_ELF_NVRREG = 33
+};
+
+enum {
+ ARM_ELF_GREGSET_SIZE = (ARM_ELF_NGREG * 4),
+ ARM_ELF_FPREGSET_SIZE = (ARM_ELF_NFPREG * 12)
+};
+
static void
arm_linux_sigtramp_cache (struct frame_info *next_frame,
struct trad_frame_cache *this_cache,
@@ -315,6 +328,69 @@
arm_linux_rt_sigreturn_init
};
+/* Supply register REGNUM from the buffer specified by GREGS and LEN
+ in the general-purpose register set REGSET to register cache
+ REGCACHE. */
+
+void
+arm_linux_supply_gregset (const struct regset *regset,
+ struct regcache * regcache,
+ int regnum, const void *gregs, size_t size)
+{
+ int regi;
+ const bfd_byte *buf = gregs;
+
+ for (regi = 0; regi < 16; regi++)
+ regcache_raw_supply(regcache, regi, buf + 4 * regi);
+
+ regcache_raw_supply (regcache, ARM_FPS_REGNUM, buf + 4 * 16);
+ regcache_raw_supply (regcache, ARM_PS_REGNUM, buf + 4 * 17);
+}
+
+static struct regset arm_linux_gregset = {
+ NULL,
+ arm_linux_supply_gregset
+};
+
+/* Supply register REGNUM from the buffer specified by FPREGS and LEN
+ in the floating-point register set REGSET to register cache
+ REGCACHE. */
+
+void
+arm_linux_supply_fpregset (const struct regset *regset,
+ struct regcache * regcache,
+ int regnum, const void *fpregs, size_t size)
+{
+ int regi;
+ const bfd_byte *buf = fpregs;
+
+ for (regi = 0; regi < 32; regi++)
+ regcache_raw_supply (regcache, FP0_REGNUM + regi, buf + 8 * regi);
+}
+
+static struct regset arm_linux_fpregset = {
+ NULL,
+ arm_linux_supply_fpregset
+};
+
+/* Return the appropriate register set for the core section identified
+ by SECT_NAME and SECT_SIZE. */
+
+static const struct regset *
+arm_linux_regset_from_core_section (struct gdbarch *core_arch,
+ const char *sect_name, size_t sect_size)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (core_arch);
+
+ if (strcmp (sect_name, ".reg") == 0 && sect_size == ARM_ELF_GREGSET_SIZE)
+ return &arm_linux_gregset;
+
+ if (strcmp (sect_name, ".reg2") == 0 && sect_size == ARM_ELF_FPREGSET_SIZE)
+ return &arm_linux_fpregset;
+
+ return NULL;
+}
+
static void
arm_linux_init_abi (struct gdbarch_info info,
struct gdbarch *gdbarch)
@@ -361,6 +437,9 @@
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
+ set_gdbarch_regset_from_core_section
+ (gdbarch, arm_linux_regset_from_core_section);
+
tramp_frame_prepend_unwinder (gdbarch,
&arm_linux_sigreturn_tramp_frame);
tramp_frame_prepend_unwinder (gdbarch,
Index: cvs-6.4/gdb/config/arm/linux.mt
===================================================================
--- cvs-6.4.orig/gdb/config/arm/linux.mt 2006-02-24 03:22:21.000000000 -0500
+++ cvs-6.4/gdb/config/arm/linux.mt 2006-02-24 03:22:27.000000000 -0500
@@ -1,3 +1,3 @@
# Target: ARM based machine running GNU/Linux
DEPRECATED_TM_FILE= tm-linux.h
-TDEPFILES= arm-tdep.o arm-linux-tdep.o glibc-tdep.o solib.o solib-svr4.o solib-legacy.o symfile-mem.o
+TDEPFILES= arm-tdep.o arm-linux-tdep.o glibc-tdep.o solib.o solib-svr4.o solib-legacy.o symfile-mem.o corelow.o
next prev parent reply other threads:[~2006-02-24 11:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-15 11:05 Girish Shilamkar
2006-02-15 11:51 ` Richard Earnshaw
2006-02-15 13:05 ` Girish Shilamkar
2006-02-15 11:55 ` Mark Kettenis
2006-02-24 14:01 ` Girish Shilamkar [this message]
2006-02-24 22:41 ` Mark Kettenis
2006-03-08 15:38 ` Girish Shilamkar
2006-03-13 20:21 ` Girish Shilamkar
2006-03-14 3:36 ` Daniel Jacobowitz
[not found] ` <1142260008.2867.13.camel@krypton>
2006-03-14 15:44 ` Daniel Jacobowitz
[not found] ` <20060313202419.GB24419@nevyn.them.org>
2006-03-15 14:47 ` Girish Shilamkar
2006-03-15 16:11 ` Daniel Jacobowitz
2006-02-25 4:38 ` Randolph Chung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1140781305.3228.13.camel@krypton \
--to=girish@linsyssoft.com \
--cc=gdb-patches@sources.redhat.com \
--cc=mark.kettenis@xs4all.nl \
--cc=rearnsha@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox