gdb/ChangeLog:

* regformats/regdat.sh: Rename init_registers function in
	generated file to init_registers_${name}.

	* regformats/reg-crisv32.dat: Set "name" to crisv32.
	* regformats/reg-ppc64.dat: Set "name" to ppc64.
	* regformats/reg-s390x.dat: Set "name" to s390x.

gdbserver/ChangeLog:

	* server.h (init_registers): Remove prototype.

	* linux-low.h (struct linux_target_ops): Add arch_setup field.
	* linux-low.c (initialize_low): Call the_low_target.arch_setup ()
	instead of init_registers ().
	* linux-arm-low.c (init_registers_arm): Add prototype.
	(init_registers_arm_with_iwmmxt): Likewise.
	(the_low_target): Add initializer for arch_setup field.
	* linux-cris-low.c (init_registers_cris): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-crisv32-low.c (init_registers_crisv32): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-i386-low.c (init_registers_i386_linux): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-ia64-low.c (init_registers_ia64): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-m32r-low.c (init_registers_m32r): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-m68k-low.c (init_registers_m68k): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-mips-low.c (init_registers_mips_linux): Add prototype.
	(init_registers_mips64_linux): Likewise.
	(the_low_target): Add initializer for arch_setup field.
	* linux-ppc-low.c (init_registers_ppc): Add prototype.
	(init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
	(the_low_target): Add initializer for arch_setup field.
	* linux-ppc64-low.c (init_registers_ppc64): Add prototype.
	(init_registers_powerpc_64): Likewise.
	(the_low_target): Add initializer for arch_setup field.
	* linux-s390-low.c (init_registers_s390): Add prototype.
	(init_registers_s390x): Likewise.
	(the_low_target): Add initializer for arch_setup field.
	* linux-sh-low.c (init_registers_sh): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* linux-xtensa-low.c (init_registers_xtensa): Add prototype.
	(the_low_target): Add initializer for arch_setup field.

	* win32-low.h (struct win32_target_ops): Add arch_setup field.
	* win32-low.c (initialize_low): Call the_low_target.arch_setup ()
	instead of init_registers ().
	* win32-arm-low.c (init_registers_arm): Add prototype.
	(the_low_target): Add initializer for arch_setup field.
	* win32-i386-low.c (init_registers_i386): Add prototype.
	(the_low_target): Add initializer for arch_setup field.

	* spu-low.c (init_registers_spu): Add prototype.
	(initialize_low): Call initialie_registers_spu () instead of
	initialize_registers ().
This commit is contained in:
Ulrich Weigand 2008-02-27 03:27:40 +00:00
parent a5d9d57db1
commit d05b4ac3aa
28 changed files with 181 additions and 11 deletions

View File

@ -1,3 +1,12 @@
2008-02-27 Ulrich Weigand <uweigand@de.ibm.com>
* regformats/regdat.sh: Rename init_registers function in
generated file to init_registers_${name}.
* regformats/reg-crisv32.dat: Set "name" to crisv32.
* regformats/reg-ppc64.dat: Set "name" to ppc64.
* regformats/reg-s390x.dat: Set "name" to s390x.
2008-02-26 Greg Law <glaw@undo-software.com>
* regcache.c (registers_changed): Call reinit_frame_cache.

View File

@ -1,3 +1,56 @@
2008-02-27 Ulrich Weigand <uweigand@de.ibm.com>
* server.h (init_registers): Remove prototype.
* linux-low.h (struct linux_target_ops): Add arch_setup field.
* linux-low.c (initialize_low): Call the_low_target.arch_setup ()
instead of init_registers ().
* linux-arm-low.c (init_registers_arm): Add prototype.
(init_registers_arm_with_iwmmxt): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-cris-low.c (init_registers_cris): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-crisv32-low.c (init_registers_crisv32): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-i386-low.c (init_registers_i386_linux): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-ia64-low.c (init_registers_ia64): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-m32r-low.c (init_registers_m32r): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-m68k-low.c (init_registers_m68k): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-mips-low.c (init_registers_mips_linux): Add prototype.
(init_registers_mips64_linux): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-ppc-low.c (init_registers_ppc): Add prototype.
(init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-ppc64-low.c (init_registers_ppc64): Add prototype.
(init_registers_powerpc_64): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-s390-low.c (init_registers_s390): Add prototype.
(init_registers_s390x): Likewise.
(the_low_target): Add initializer for arch_setup field.
* linux-sh-low.c (init_registers_sh): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* linux-xtensa-low.c (init_registers_xtensa): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* win32-low.h (struct win32_target_ops): Add arch_setup field.
* win32-low.c (initialize_low): Call the_low_target.arch_setup ()
instead of init_registers ().
* win32-arm-low.c (init_registers_arm): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* win32-i386-low.c (init_registers_i386): Add prototype.
(the_low_target): Add initializer for arch_setup field.
* spu-low.c (init_registers_spu): Add prototype.
(initialize_low): Call initialie_registers_spu () instead of
initialize_registers ().
2008-02-19 Pedro Alves <pedro@codesourcery.com>
* server.c (handle_v_requests): When handling the vRun and vAttach

View File

@ -24,6 +24,11 @@
#include "gdb_proc_service.h"
/* Defined in auto-generated file reg-arm.c. */
void init_registers_arm (void);
/* Defined in auto-generated file arm-with-iwmmxt.c. */
void init_registers_arm_with_iwmmxt (void);
#ifndef PTRACE_GET_THREAD_AREA
#define PTRACE_GET_THREAD_AREA 22
#endif
@ -200,6 +205,11 @@ struct regset_info target_regsets[] = {
};
struct linux_target_ops the_low_target = {
#ifdef __IWMMXT__
init_registers_arm_with_iwmmxt,
#else
init_registers_arm,
#endif
arm_num_regs,
arm_regmap,
arm_cannot_fetch_register,

View File

@ -21,6 +21,9 @@
#include "linux-low.h"
#include <sys/ptrace.h>
/* Defined in auto-generated file reg-cris.c. */
void init_registers_cris (void);
/* CRISv10 */
#define cris_num_regs 32
@ -105,6 +108,7 @@ cris_reinsert_addr (void)
}
struct linux_target_ops the_low_target = {
init_registers_cris,
cris_num_regs,
cris_regmap,
cris_cannot_fetch_register,

View File

@ -21,6 +21,9 @@
#include "linux-low.h"
#include <sys/ptrace.h>
/* Defined in auto-generated file reg-crisv32.c. */
void init_registers_crisv32 (void);
/* CRISv32 */
#define cris_num_regs 49
@ -360,6 +363,7 @@ struct regset_info target_regsets[] = {
};
struct linux_target_ops the_low_target = {
init_register_crisv32,
-1,
NULL,
NULL,

View File

@ -33,6 +33,10 @@
#define PTRACE_GET_THREAD_AREA 25
#endif
/* Defined in auto-generated file reg-i386-linux.c. */
void init_registers_i386_linux (void);
/* This module only supports access to the general purpose registers. */
#define i386_num_regs 16
@ -185,6 +189,7 @@ i386_breakpoint_at (CORE_ADDR pc)
}
struct linux_target_ops the_low_target = {
init_registers_i386_linux,
i386_num_regs,
i386_regmap,
i386_cannot_fetch_register,

View File

@ -24,6 +24,9 @@
#include <sys/reg.h>
#endif
/* Defined in auto-generated file reg-ia64.c. */
void init_registers_ia64 (void);
#define ia64_num_regs 462
#include <asm/ptrace_offsets.h>
@ -276,6 +279,7 @@ ia64_cannot_fetch_register (int regno)
}
struct linux_target_ops the_low_target = {
init_registers_ia64,
ia64_num_regs,
ia64_regmap,
ia64_cannot_fetch_register,

View File

@ -2072,7 +2072,7 @@ initialize_low (void)
set_target_ops (&linux_target_ops);
set_breakpoint_data (the_low_target.breakpoint,
the_low_target.breakpoint_len);
init_registers ();
the_low_target.arch_setup ();
linux_init_signals ();
linux_test_for_tracefork ();
}

View File

@ -42,6 +42,9 @@ extern struct regset_info target_regsets[];
struct linux_target_ops
{
/* Architecture-specific setup. */
void (*arch_setup) (void);
int num_regs;
int *regmap;
int (*cannot_fetch_register) (int);

View File

@ -23,6 +23,9 @@
#include <sys/reg.h>
#endif
/* Defined in auto-generated file reg-m32r.c. */
void init_registers_m32r (void);
#define m32r_num_regs 25
static int m32r_regmap[] = {
@ -83,6 +86,7 @@ m32r_breakpoint_at (CORE_ADDR where)
}
struct linux_target_ops the_low_target = {
init_registers_m32r,
m32r_num_regs,
m32r_regmap,
m32r_cannot_fetch_register,

View File

@ -20,6 +20,9 @@
#include "server.h"
#include "linux-low.h"
/* Defined in auto-generated file reg-m68k.c. */
void init_registers_m68k (void);
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
@ -152,6 +155,7 @@ m68k_breakpoint_at (CORE_ADDR pc)
}
struct linux_target_ops the_low_target = {
init_registers_m68k,
m68k_num_regs,
m68k_regmap,
m68k_cannot_fetch_register,

View File

@ -25,6 +25,11 @@
#include "gdb_proc_service.h"
/* Defined in auto-generated file mips-linux.c. */
void init_registers_mips_linux (void);
/* Defined in auto-generated file mips64-linux.c. */
void init_registers_mips64_linux (void);
#ifndef PTRACE_GET_THREAD_AREA
#define PTRACE_GET_THREAD_AREA 25
#endif
@ -329,6 +334,11 @@ struct regset_info target_regsets[] = {
};
struct linux_target_ops the_low_target = {
#ifdef __mips64
init_registers_mips64_linux,
#else
init_registers_mips_linux,
#endif
mips_num_regs,
mips_regmap,
mips_cannot_fetch_register,

View File

@ -23,6 +23,13 @@
#include <asm/ptrace.h>
/* Defined in auto-generated file reg-ppc.c. */
void init_registers_ppc (void);
/* Defined in auto-generated file powerpc-32.c. */
void init_registers_powerpc_32 (void);
/* Defined in auto-generated file powerpc-e500.c. */
void init_registers_powerpc_e500 (void);
#define ppc_num_regs 71
/* Currently, don't check/send MQ. */
@ -231,6 +238,15 @@ struct regset_info target_regsets[] = {
};
struct linux_target_ops the_low_target = {
#ifdef __ALTIVEC__
init_registers_powerpc_32,
#else
#ifdef __SPE__
init_registers_powerpc_e500,
#else
init_registers_ppc,
#endif
#endif
ppc_num_regs,
ppc_regmap,
ppc_cannot_fetch_register,

View File

@ -21,6 +21,11 @@
#include "server.h"
#include "linux-low.h"
/* Defined in auto-generated file reg-ppc64.c. */
void init_registers_ppc64 (void);
/* Defined in auto-generated file powerpc-64.c. */
void init_registers_powerpc_64 (void);
#include <asm/ptrace.h>
#define ppc_num_regs 71
@ -162,6 +167,11 @@ struct regset_info target_regsets[] = {
};
struct linux_target_ops the_low_target = {
#ifdef __ALTIVEC__
init_registers_powerpc_64,
#else
init_registers_ppc64,
#endif
ppc_num_regs,
ppc_regmap,
ppc_cannot_fetch_register,

View File

@ -25,6 +25,12 @@
#include <asm/ptrace.h>
/* Defined in auto-generated file reg-s390.c. */
void init_registers_s390 (void);
/* Defined in auto-generated file reg-s390x.c. */
void init_registers_s390x (void);
#define s390_num_regs 51
static int s390_regmap[] = {
@ -124,6 +130,11 @@ s390_breakpoint_at (CORE_ADDR pc)
struct linux_target_ops the_low_target = {
#ifndef __s390x__
init_registers_s390,
#else
init_registers_s390x,
#endif
s390_num_regs,
s390_regmap,
s390_cannot_fetch_register,

View File

@ -20,6 +20,9 @@
#include "server.h"
#include "linux-low.h"
/* Defined in auto-generated file reg-sh.c. */
void init_registers_sh (void);
#ifdef HAVE_SYS_REG_H
#include <sys/reg.h>
#endif
@ -106,6 +109,7 @@ struct regset_info target_regsets[] = {
};
struct linux_target_ops the_low_target = {
init_registers_sh,
sh_num_regs,
sh_regmap,
sh_cannot_fetch_register,

View File

@ -24,6 +24,9 @@
#include "gdb_proc_service.h"
/* Defined in auto-generated file reg-x86-64-linux.c. */
void init_registers_x86_64_linux (void);
#include <sys/reg.h>
#include <sys/procfs.h>
#include <sys/ptrace.h>
@ -160,6 +163,7 @@ x86_64_breakpoint_at (CORE_ADDR pc)
}
struct linux_target_ops the_low_target = {
init_registers_x86_64_linux,
-1,
NULL,
NULL,

View File

@ -20,6 +20,9 @@
#include "server.h"
#include "linux-low.h"
/* Defined in auto-generated file reg-xtensa.c. */
void init_registers_xtensa (void);
#include <sys/ptrace.h>
#include <xtensa-config.h>
@ -173,6 +176,7 @@ xtensa_breakpoint_at (CORE_ADDR where)
}
struct linux_target_ops the_low_target = {
init_registers_xtensa,
0,
0,
0,

View File

@ -221,10 +221,6 @@ void error (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
void fatal (const char *string,...) ATTR_NORETURN ATTR_FORMAT (printf, 1, 2);
void warning (const char *string,...) ATTR_FORMAT (printf, 1, 2);
/* Functions from the register cache definition. */
void init_registers (void);
/* Maximum number of bytes to read/write at once. The value here
is chosen to fill up a packet (the headers account for the 32). */
#define MAXBUFBYTES(N) (((N)-32)/2)

View File

@ -57,6 +57,9 @@
/* These are used in remote-utils.c. */
int using_threads = 0;
/* Defined in auto-generated file reg-spu.c. */
void init_registers_spu (void);
/* Fetch PPU register REGNO. */
static CORE_ADDR
@ -600,5 +603,5 @@ initialize_low (void)
set_target_ops (&spu_target_ops);
set_breakpoint_data (breakpoint, sizeof breakpoint);
init_registers ();
init_registers_spu ();
}

View File

@ -22,6 +22,10 @@
#define CONTEXT_FLOATING_POINT 0
#endif
/* Defined in auto-generated file reg-arm.c. */
void init_registers_arm (void);
static void
arm_get_thread_context (win32_thread_info *th, DEBUG_EVENT* current_event)
{
@ -107,6 +111,7 @@ static const unsigned long arm_wince_breakpoint = 0xe6000010;
#define arm_wince_breakpoint_len 4
struct win32_target_ops the_low_target = {
init_registers_arm,
sizeof (mappings) / sizeof (mappings[0]),
NULL, /* initial_stuff */
arm_get_thread_context,

View File

@ -23,6 +23,9 @@
#define FLAG_TRACE_BIT 0x100
/* Defined in auto-generated file reg-i386.c. */
void init_registers_i386 (void);
static unsigned dr[8];
static int debug_registers_changed = 0;
@ -191,6 +194,7 @@ i386_store_inferior_register (win32_thread_info *th, int r)
}
struct win32_target_ops the_low_target = {
init_registers_i386,
sizeof (mappings) / sizeof (mappings[0]),
i386_initial_stuff,
i386_get_thread_context,

View File

@ -1740,5 +1740,5 @@ initialize_low (void)
if (the_low_target.breakpoint != NULL)
set_breakpoint_data (the_low_target.breakpoint,
the_low_target.breakpoint_len);
init_registers ();
the_low_target.arch_setup ();
}

View File

@ -42,6 +42,9 @@ typedef struct win32_thread_info
struct win32_target_ops
{
/* Architecture-specific setup. */
void (*arch_setup) (void);
/* The number of target registers. */
int num_regs;

View File

@ -1,4 +1,4 @@
name:cris
name:crisv32
expedite:r8,sp,pc
32:r0
32:r1

View File

@ -1,4 +1,4 @@
name:ppc
name:ppc64
expedite:r1,pc
64:r0
64:r1

View File

@ -1,4 +1,4 @@
name:s390
name:s390x
expedite:r14,r15,pswa
64:pswm
64:pswa

View File

@ -155,7 +155,7 @@ echo
cat <<EOF
void
init_registers ()
init_registers_${name} ()
{
set_register_cache (regs_${name},
sizeof (regs_${name}) / sizeof (regs_${name}[0]));