+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.
*/
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;
{
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];
/* ??? 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)
}
else
{
- regcache_raw_supply (current_regcache, regno, core_reg_sect + addr);
+ regcache_raw_supply (regcache, regno, core_reg_sect + addr);
}
}
if (bad_reg >= 0)
};
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;
/* 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;
/* 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;
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;
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;
{
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;
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)
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)));
}
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 ();
}
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;
else
{
memcpy (&gregset, core_reg_sect, sizeof (gregset));
- cris_supply_gregset (current_regcache, &gregset);
+ cris_supply_gregset (regcache, &gregset);
}
default:
#define GDBCORE_H 1
struct type;
+struct regcache;
#include "bfd.h"
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.
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);
#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 */
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;
for (regno = 0; regno < NUM_REGS; regno++)
{
- regcache_raw_supply (current_regcache, regno, srcp);
+ regcache_raw_supply (regcache, regno, srcp);
srcp += regsize;
}
}
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;
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;
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;
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;
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
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
}
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)
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
}
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)
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