aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog22
-rw-r--r--gdb/alpha-nat.c9
-rw-r--r--gdb/armnbsd-nat.c14
-rw-r--r--gdb/core-regset.c7
-rw-r--r--gdb/corelow.c16
-rw-r--r--gdb/cris-tdep.c5
-rw-r--r--gdb/gdbcore.h8
-rw-r--r--gdb/irix5-nat.c8
-rw-r--r--gdb/m68klinux-nat.c7
-rw-r--r--gdb/mips-linux-tdep.c11
-rw-r--r--gdb/win32-nat.c5
-rw-r--r--gdb/windows-nat.c5
12 files changed, 78 insertions, 39 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c7b921b..2b1bbd8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,27 @@
2007-05-06 Ulrich Weigand <uweigand@de.ibm.com>
+ * gdbcore.h (struct regcache): Add forward declaration.
+ (struct core_fns): Add REGCACHE argument to core_read_registers
+ callback.
+ * corelow.c (get_core_register_section): Add REGCACHE argument,
+ use it instead of current_regcache, pass it to core_read_registers
+ callback.
+ (get_core_registers): Add current_regcache as parameter to
+ get_core_register_section calls.
+
+ * alpha-nat.c (fetch_osf_core_registers): Add REGCACHE argument,
+ use it instead of current_regcache.
+ * armnbsd-nat.c (fetch_core_registers): Likewise.
+ (fetch_elfcore_registers): Likewise.
+ * core-regset.c (fetch_core_registers): Likewise.
+ * cris-tdep.c (fetch_core_registers): Likewise.
+ * irix5-nat.c (fetch_core_registers): Likewise.
+ * m68klinux-nat.c (fetch_core_registers): Likewise.
+ * mips-linux-tdep.c (fetch_core_registers): Likewise.
+ * win32-nat.c (fetch_elf_core_registers): Likewise.
+
+2007-05-06 Ulrich Weigand <uweigand@de.ibm.com>
+
* gregset.h (struct regcache): Add forward declaration.
(supply_gregset): Add REGCACHE parameter, make GREGS const.
(supply_fpregset): Add REGCACHE parameter, make FPREGS const.
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index bea5bcd..9cede3c 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -47,7 +47,8 @@
*/
static void
-fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
+fetch_osf_core_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
int regno;
@@ -90,7 +91,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
{
if (CANNOT_FETCH_REGISTER (regno))
{
- regcache_raw_supply (current_regcache, regno, NULL);
+ regcache_raw_supply (regcache, regno, NULL);
continue;
}
addr = 8 * core_reg_mapping[regno];
@@ -99,7 +100,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
/* ??? UNIQUE is a new addition. Don't generate an error. */
if (regno == ALPHA_UNIQUE_REGNUM)
{
- regcache_raw_supply (current_regcache, regno, NULL);
+ regcache_raw_supply (regcache, regno, NULL);
continue;
}
if (bad_reg < 0)
@@ -107,7 +108,7 @@ fetch_osf_core_registers (char *core_reg_sect, unsigned core_reg_size,
}
else
{
- regcache_raw_supply (current_regcache, regno, core_reg_sect + addr);
+ regcache_raw_supply (regcache, regno, core_reg_sect + addr);
}
}
if (bad_reg >= 0)
diff --git a/gdb/armnbsd-nat.c b/gdb/armnbsd-nat.c
index 222cc56..d2b5f6c 100644
--- a/gdb/armnbsd-nat.c
+++ b/gdb/armnbsd-nat.c
@@ -414,19 +414,21 @@ struct md_core
};
static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+fetch_core_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR ignore)
{
struct md_core *core_reg = (struct md_core *) core_reg_sect;
int regno;
CORE_ADDR r_pc;
- arm_supply_gregset (current_regcache, &core_reg->intreg);
- arm_supply_fparegset (current_regcache, &core_reg->freg);
+ arm_supply_gregset (regcache, &core_reg->intreg);
+ arm_supply_fparegset (regcache, &core_reg->freg);
}
static void
-fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
+fetch_elfcore_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR ignore)
{
struct reg gregset;
@@ -442,7 +444,7 @@ fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
/* The memcpy may be unnecessary, but we can't really be sure
of the alignment of the data in the core file. */
memcpy (&gregset, core_reg_sect, sizeof (gregset));
- arm_supply_gregset (current_regcache, &gregset);
+ arm_supply_gregset (regcache, &gregset);
}
break;
@@ -454,7 +456,7 @@ fetch_elfcore_registers (char *core_reg_sect, unsigned core_reg_size,
/* The memcpy may be unnecessary, but we can't really be sure
of the alignment of the data in the core file. */
memcpy (&fparegset, core_reg_sect, sizeof (fparegset));
- arm_supply_fparegset (current_regcache, &fparegset);
+ arm_supply_fparegset (regcache, &fparegset);
}
break;
diff --git a/gdb/core-regset.c b/gdb/core-regset.c
index a43922d..8dc2c78 100644
--- a/gdb/core-regset.c
+++ b/gdb/core-regset.c
@@ -60,7 +60,8 @@
REG_ADDR is ignored. */
static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
+fetch_core_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size, int which,
CORE_ADDR reg_addr)
{
gdb_gregset_t gregset;
@@ -74,7 +75,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
else
{
memcpy (&gregset, core_reg_sect, sizeof (gregset));
- supply_gregset (current_regcache, (const gdb_gregset_t *) &gregset);
+ supply_gregset (regcache, (const gdb_gregset_t *) &gregset);
}
break;
@@ -85,7 +86,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size, int which,
{
memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
if (FP0_REGNUM >= 0)
- supply_fpregset (current_regcache, (const gdb_fpregset_t *) &fpregset);
+ supply_fpregset (regcache, (const gdb_fpregset_t *) &fpregset);
}
break;
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 267833e..f38934e 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -417,7 +417,8 @@ core_detach (char *args, int from_tty)
have a section by the appropriate name. Otherwise, just do nothing. */
static void
-get_core_register_section (char *name,
+get_core_register_section (struct regcache *regcache,
+ char *name,
int which,
char *human_name,
int required)
@@ -464,12 +465,12 @@ get_core_register_section (char *name,
return;
}
- regset->supply_regset (regset, current_regcache, -1, contents, size);
+ regset->supply_regset (regset, regcache, -1, contents, size);
return;
}
gdb_assert (core_vec);
- core_vec->core_read_registers (contents, size, which,
+ core_vec->core_read_registers (regcache, contents, size, which,
((CORE_ADDR)
bfd_section_vma (core_bfd, section)));
}
@@ -494,9 +495,12 @@ get_core_registers (int regno)
return;
}
- get_core_register_section (".reg", 0, "general-purpose", 1);
- get_core_register_section (".reg2", 2, "floating-point", 0);
- get_core_register_section (".reg-xfp", 3, "extended floating-point", 0);
+ get_core_register_section (current_regcache,
+ ".reg", 0, "general-purpose", 1);
+ get_core_register_section (current_regcache,
+ ".reg2", 2, "floating-point", 0);
+ get_core_register_section (current_regcache,
+ ".reg-xfp", 3, "extended floating-point", 0);
deprecated_registers_fetched ();
}
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index fed61a7..aaeeee8 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -3887,7 +3887,8 @@ cris_supply_gregset (struct regcache *regcache, elf_gregset_t *gregsetp)
regsets, until multi-arch core support is ready. */
static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+fetch_core_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
elf_gregset_t gregset;
@@ -3903,7 +3904,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
else
{
memcpy (&gregset, core_reg_sect, sizeof (gregset));
- cris_supply_gregset (current_regcache, &gregset);
+ cris_supply_gregset (regcache, &gregset);
}
default:
diff --git a/gdb/gdbcore.h b/gdb/gdbcore.h
index ea2411e..8aa6b36 100644
--- a/gdb/gdbcore.h
+++ b/gdb/gdbcore.h
@@ -26,6 +26,7 @@
#define GDBCORE_H 1
struct type;
+struct regcache;
#include "bfd.h"
@@ -168,8 +169,8 @@ struct core_fns
int (*core_sniffer) (struct core_fns *, bfd *);
- /* Extract the register values out of the core file and store them where
- `read_register' will find them.
+ /* Extract the register values out of the core file and supply them
+ into REGCACHE.
CORE_REG_SECT points to the register values themselves, read into
memory.
@@ -189,7 +190,8 @@ struct core_fns
registers in a large upage-plus-stack ".reg" section. Original upage
address X is at location core_reg_sect+x+reg_addr. */
- void (*core_read_registers) (char *core_reg_sect,
+ void (*core_read_registers) (struct regcache *regcache,
+ char *core_reg_sect,
unsigned core_reg_size,
int which, CORE_ADDR reg_addr);
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 907764c..880568e 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -40,7 +40,8 @@
#include "gregset.h"
#include "mips-tdep.h"
-static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR);
+static void fetch_core_registers (struct regcache *, char *,
+ unsigned int, int, CORE_ADDR);
/* Size of elements in jmpbuf */
@@ -242,7 +243,8 @@ get_longjmp_target (CORE_ADDR *pc)
REG_ADDR is also unused. */
static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+fetch_core_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
char *srcp = core_reg_sect;
@@ -259,7 +261,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
for (regno = 0; regno < NUM_REGS; regno++)
{
- regcache_raw_supply (current_regcache, regno, srcp);
+ regcache_raw_supply (regcache, regno, srcp);
srcp += regsize;
}
}
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index e2d2af2..2a25b34 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -528,7 +528,8 @@ m68k_linux_store_inferior_registers (int regno)
REG_ADDR isn't used on GNU/Linux. */
static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+fetch_core_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
elf_gregset_t gregset;
@@ -542,7 +543,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
else
{
memcpy (&gregset, core_reg_sect, sizeof (gregset));
- supply_gregset (current_regcache, (const elf_gregset_t *) &gregset);
+ supply_gregset (regcache, (const elf_gregset_t *) &gregset);
}
break;
@@ -552,7 +553,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
else
{
memcpy (&fpregset, core_reg_sect, sizeof (fpregset));
- supply_fpregset (current_regcache, (const elf_fpregset_t *) &fpregset);
+ supply_fpregset (regcache, (const elf_fpregset_t *) &fpregset);
}
break;
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 2407cc7..4ca20ac 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -472,7 +472,8 @@ mips64_fill_fpregset (const struct regcache *regcache,
regsets, until multi-arch core support is ready. */
static void
-fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
+fetch_core_registers (struct regcache *regcache,
+ char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
mips_elf_gregset_t gregset;
@@ -485,13 +486,13 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size == sizeof (gregset))
{
memcpy ((char *) &gregset, core_reg_sect, sizeof (gregset));
- mips_supply_gregset (current_regcache,
+ mips_supply_gregset (regcache,
(const mips_elf_gregset_t *) &gregset);
}
else if (core_reg_size == sizeof (gregset64))
{
memcpy ((char *) &gregset64, core_reg_sect, sizeof (gregset64));
- mips64_supply_gregset (current_regcache,
+ mips64_supply_gregset (regcache,
(const mips64_elf_gregset_t *) &gregset64);
}
else
@@ -504,14 +505,14 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
if (core_reg_size == sizeof (fpregset))
{
memcpy ((char *) &fpregset, core_reg_sect, sizeof (fpregset));
- mips_supply_fpregset (current_regcache,
+ mips_supply_fpregset (regcache,
(const mips_elf_fpregset_t *) &fpregset);
}
else if (core_reg_size == sizeof (fpregset64))
{
memcpy ((char *) &fpregset64, core_reg_sect,
sizeof (fpregset64));
- mips64_supply_fpregset (current_regcache,
+ mips64_supply_fpregset (regcache,
(const mips64_elf_fpregset_t *) &fpregset64);
}
else
diff --git a/gdb/win32-nat.c b/gdb/win32-nat.c
index 28f9b82..7d6aab0 100644
--- a/gdb/win32-nat.c
+++ b/gdb/win32-nat.c
@@ -2244,7 +2244,8 @@ win32_current_sos (void)
}
static void
-fetch_elf_core_registers (char *core_reg_sect,
+fetch_elf_core_registers (struct regcache *regcache,
+ char *core_reg_sect,
unsigned core_reg_size,
int which,
CORE_ADDR reg_addr)
@@ -2256,7 +2257,7 @@ fetch_elf_core_registers (char *core_reg_sect,
return;
}
for (r = 0; r < NUM_REGS; r++)
- regcache_raw_supply (current_regcache, r, core_reg_sect + mappings[r]);
+ regcache_raw_supply (regcache, r, core_reg_sect + mappings[r]);
}
static int
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 28f9b82..7d6aab0 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -2244,7 +2244,8 @@ win32_current_sos (void)
}
static void
-fetch_elf_core_registers (char *core_reg_sect,
+fetch_elf_core_registers (struct regcache *regcache,
+ char *core_reg_sect,
unsigned core_reg_size,
int which,
CORE_ADDR reg_addr)
@@ -2256,7 +2257,7 @@ fetch_elf_core_registers (char *core_reg_sect,
return;
}
for (r = 0; r < NUM_REGS; r++)
- regcache_raw_supply (current_regcache, r, core_reg_sect + mappings[r]);
+ regcache_raw_supply (regcache, r, core_reg_sect + mappings[r]);
}
static int