From: Ricard Wanderlof <ricard.wanderlof@axis.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 2/2][CRIS/CRISv32] Consistent names for cris/crisv32_elf_greg_t
Date: Tue, 03 Sep 2013 14:17:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.00.1309031617060.10770@lnxricardw.se.axis.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2607 bytes --]
This is just a cosmetic change to get consistent names for
elf_greg_t/crisv32_elf_greg_t in cris-tdep.c . Compile-time tested, then
tested the result by running the resulting gdb against gdbserver running
on a target system.
Patch included inline for review and as attachement for use.
Signed-off-by: Ricard Wanderlof <ricardw@axis.com>
2013-09-03 Ricard Wanderlof <ricardw@axis.com>
* cris-tdep.c (cris_elf_greg_t): Rename from elf_greg_t.
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 80ab1b8..1b0e3cd 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -3819,25 +3819,25 @@ cris_delayed_get_disassembler (bfd_vma addr, struct disassemble_info *info)
return print_insn (addr, info);
}
-/* Copied from <asm/elf.h>. */
-typedef unsigned char elf_greg_t[4];
+/* Originally from <asm/elf.h>. */
+typedef unsigned char cris_elf_greg_t[4];
/* Same as user_regs_struct struct in <asm/user.h>. */
#define CRISV10_ELF_NGREG 35
-typedef elf_greg_t elf_gregset_t[CRISV10_ELF_NGREG];
+typedef cris_elf_greg_t cris_elf_gregset_t[CRISV10_ELF_NGREG];
#define CRISV32_ELF_NGREG 32
-typedef elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG];
+typedef cris_elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG];
-/* Unpack an elf_gregset_t into GDB's register cache. */
+/* Unpack a cris_elf_gregset_t into GDB's register cache. */
static void
-cris_supply_gregset (struct regcache *regcache, elf_gregset_t *gregsetp)
+cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
int i;
- elf_greg_t *regp = *gregsetp;
+ cris_elf_greg_t *regp = *gregsetp;
static char zerobuf[4] = {0};
/* The kernel dumps all 32 registers as unsigned longs, but supply_register
@@ -3868,12 +3868,12 @@ fetch_core_registers (struct regcache *regcache,
char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
- elf_gregset_t gregset;
+ cris_elf_gregset_t gregset;
switch (which)
{
case 0:
- if (core_reg_size != sizeof (elf_gregset_t)
+ if (core_reg_size != sizeof (cris_elf_gregset_t)
&& core_reg_size != sizeof (crisv32_elf_gregset_t))
{
warning (_("wrong size gregset struct in core file"));
/Ricard
--
Ricard Wolf Wanderlöf ricardw(at)axis.com
Axis Communications AB, Lund, Sweden www.axis.com
Phone +46 46 272 2016 Fax +46 46 13 61 30
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch file.patch --]
[-- Type: text/x-diff; name="cris-head-cleanup-elf_greg_t.patch", Size: 1959 bytes --]
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 80ab1b8..1b0e3cd 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -3819,25 +3819,25 @@ cris_delayed_get_disassembler (bfd_vma addr, struct disassemble_info *info)
return print_insn (addr, info);
}
-/* Copied from <asm/elf.h>. */
-typedef unsigned char elf_greg_t[4];
+/* Originally from <asm/elf.h>. */
+typedef unsigned char cris_elf_greg_t[4];
/* Same as user_regs_struct struct in <asm/user.h>. */
#define CRISV10_ELF_NGREG 35
-typedef elf_greg_t elf_gregset_t[CRISV10_ELF_NGREG];
+typedef cris_elf_greg_t cris_elf_gregset_t[CRISV10_ELF_NGREG];
#define CRISV32_ELF_NGREG 32
-typedef elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG];
+typedef cris_elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG];
-/* Unpack an elf_gregset_t into GDB's register cache. */
+/* Unpack a cris_elf_gregset_t into GDB's register cache. */
static void
-cris_supply_gregset (struct regcache *regcache, elf_gregset_t *gregsetp)
+cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
int i;
- elf_greg_t *regp = *gregsetp;
+ cris_elf_greg_t *regp = *gregsetp;
static char zerobuf[4] = {0};
/* The kernel dumps all 32 registers as unsigned longs, but supply_register
@@ -3868,12 +3868,12 @@ fetch_core_registers (struct regcache *regcache,
char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
- elf_gregset_t gregset;
+ cris_elf_gregset_t gregset;
switch (which)
{
case 0:
- if (core_reg_size != sizeof (elf_gregset_t)
+ if (core_reg_size != sizeof (cris_elf_gregset_t)
&& core_reg_size != sizeof (crisv32_elf_gregset_t))
{
warning (_("wrong size gregset struct in core file"));
next reply other threads:[~2013-09-03 14:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 14:17 Ricard Wanderlof [this message]
2013-09-03 14:55 ` Pedro Alves
2013-09-06 8:25 ` Ricard Wanderlof
2013-09-03 15:17 Ricard Wanderlof
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=alpine.DEB.2.00.1309031617060.10770@lnxricardw.se.axis.com \
--to=ricard.wanderlof@axis.com \
--cc=gdb-patches@sourceware.org \
/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