mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-02-02 06:54:54 +00:00
Multi-arch CANNOT_FETCH_REGISTER() and CANNOT_STORE_REGISTER().
This commit is contained in:
parent
22cbd7fb8c
commit
01fb743397
@ -1,3 +1,14 @@
|
||||
2001-06-15 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* gdbarch.sh (CANNOT_FETCH_REGISTER): Multi-arch.
|
||||
(CANNOT_STORE_REGISTER): Ditto.
|
||||
* infptrace.c (CANNOT_FETCH_REGISTER): Delete definition.
|
||||
(CANNOT_STORE_REGISTER): Ditto.
|
||||
* regcache.c (CANNOT_STORE_REGISTER): Ditto.
|
||||
* lynx-nat.c (CANNOT_STORE_REGISTER): Ditto.
|
||||
* arch-utils.h (cannot_register_not): Define.
|
||||
* arch-utils.c (cannot_register_not): Declare.
|
||||
|
||||
2001-06-15 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* gdbarch.sh: Clarify pre/post default
|
||||
|
@ -306,6 +306,12 @@ init_frame_pc_noop (int fromleaf, struct frame_info *prev)
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
cannot_register_not (int regnum)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Functions to manipulate the endianness of the target. */
|
||||
|
||||
#ifdef TARGET_BYTE_ORDER_SELECTABLE
|
||||
|
@ -115,4 +115,9 @@ extern int generic_prepare_to_proceed (int select_it);
|
||||
|
||||
void init_frame_pc_noop (int fromleaf, struct frame_info *prev);
|
||||
|
||||
/* Version of cannot_fetch_register() / cannot_store_register() that
|
||||
always fails. */
|
||||
|
||||
int cannot_register_not (int regnum);
|
||||
|
||||
#endif
|
||||
|
@ -176,6 +176,8 @@ struct gdbarch
|
||||
gdbarch_do_registers_info_ftype *do_registers_info;
|
||||
gdbarch_register_sim_regno_ftype *register_sim_regno;
|
||||
gdbarch_register_bytes_ok_ftype *register_bytes_ok;
|
||||
gdbarch_cannot_fetch_register_ftype *cannot_fetch_register;
|
||||
gdbarch_cannot_store_register_ftype *cannot_store_register;
|
||||
int use_generic_dummy_frames;
|
||||
int call_dummy_location;
|
||||
gdbarch_call_dummy_address_ftype *call_dummy_address;
|
||||
@ -332,6 +334,8 @@ struct gdbarch startup_gdbarch =
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
generic_get_saved_register,
|
||||
0,
|
||||
0,
|
||||
@ -455,6 +459,8 @@ gdbarch_alloc (const struct gdbarch_info *info,
|
||||
gdbarch->max_register_virtual_size = -1;
|
||||
gdbarch->do_registers_info = do_registers_info;
|
||||
gdbarch->register_sim_regno = default_register_sim_regno;
|
||||
gdbarch->cannot_fetch_register = cannot_register_not;
|
||||
gdbarch->cannot_store_register = cannot_register_not;
|
||||
gdbarch->use_generic_dummy_frames = -1;
|
||||
gdbarch->call_dummy_start_offset = -1;
|
||||
gdbarch->call_dummy_breakpoint_offset = -1;
|
||||
@ -602,6 +608,8 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
||||
/* Skip verify of do_registers_info, invalid_p == 0 */
|
||||
/* Skip verify of register_sim_regno, invalid_p == 0 */
|
||||
/* Skip verify of register_bytes_ok, has predicate */
|
||||
/* Skip verify of cannot_fetch_register, invalid_p == 0 */
|
||||
/* Skip verify of cannot_store_register, invalid_p == 0 */
|
||||
if ((GDB_MULTI_ARCH >= 1)
|
||||
&& (gdbarch->use_generic_dummy_frames == -1))
|
||||
internal_error (__FILE__, __LINE__,
|
||||
@ -1042,6 +1050,18 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
"REGISTER_BYTES_OK(nr_bytes)",
|
||||
XSTRING (REGISTER_BYTES_OK (nr_bytes)));
|
||||
#endif
|
||||
#ifdef CANNOT_FETCH_REGISTER
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: %s # %s\n",
|
||||
"CANNOT_FETCH_REGISTER(reg_nr)",
|
||||
XSTRING (CANNOT_FETCH_REGISTER (reg_nr)));
|
||||
#endif
|
||||
#ifdef CANNOT_STORE_REGISTER
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: %s # %s\n",
|
||||
"CANNOT_STORE_REGISTER(reg_nr)",
|
||||
XSTRING (CANNOT_STORE_REGISTER (reg_nr)));
|
||||
#endif
|
||||
#ifdef USE_GENERIC_DUMMY_FRAMES
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: USE_GENERIC_DUMMY_FRAMES # %s\n",
|
||||
@ -1757,6 +1777,20 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
||||
(long) current_gdbarch->register_bytes_ok
|
||||
/*REGISTER_BYTES_OK ()*/);
|
||||
#endif
|
||||
#ifdef CANNOT_FETCH_REGISTER
|
||||
if (GDB_MULTI_ARCH)
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: CANNOT_FETCH_REGISTER = 0x%08lx\n",
|
||||
(long) current_gdbarch->cannot_fetch_register
|
||||
/*CANNOT_FETCH_REGISTER ()*/);
|
||||
#endif
|
||||
#ifdef CANNOT_STORE_REGISTER
|
||||
if (GDB_MULTI_ARCH)
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: CANNOT_STORE_REGISTER = 0x%08lx\n",
|
||||
(long) current_gdbarch->cannot_store_register
|
||||
/*CANNOT_STORE_REGISTER ()*/);
|
||||
#endif
|
||||
#ifdef USE_GENERIC_DUMMY_FRAMES
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: USE_GENERIC_DUMMY_FRAMES = %ld\n",
|
||||
@ -3054,6 +3088,42 @@ set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch,
|
||||
gdbarch->register_bytes_ok = register_bytes_ok;
|
||||
}
|
||||
|
||||
int
|
||||
gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int reg_nr)
|
||||
{
|
||||
if (gdbarch->cannot_fetch_register == 0)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
"gdbarch: gdbarch_cannot_fetch_register invalid");
|
||||
if (gdbarch_debug >= 2)
|
||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_fetch_register called\n");
|
||||
return gdbarch->cannot_fetch_register (reg_nr);
|
||||
}
|
||||
|
||||
void
|
||||
set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch,
|
||||
gdbarch_cannot_fetch_register_ftype cannot_fetch_register)
|
||||
{
|
||||
gdbarch->cannot_fetch_register = cannot_fetch_register;
|
||||
}
|
||||
|
||||
int
|
||||
gdbarch_cannot_store_register (struct gdbarch *gdbarch, int reg_nr)
|
||||
{
|
||||
if (gdbarch->cannot_store_register == 0)
|
||||
internal_error (__FILE__, __LINE__,
|
||||
"gdbarch: gdbarch_cannot_store_register invalid");
|
||||
if (gdbarch_debug >= 2)
|
||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_cannot_store_register called\n");
|
||||
return gdbarch->cannot_store_register (reg_nr);
|
||||
}
|
||||
|
||||
void
|
||||
set_gdbarch_cannot_store_register (struct gdbarch *gdbarch,
|
||||
gdbarch_cannot_store_register_ftype cannot_store_register)
|
||||
{
|
||||
gdbarch->cannot_store_register = cannot_store_register;
|
||||
}
|
||||
|
||||
int
|
||||
gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch)
|
||||
{
|
||||
|
@ -664,6 +664,34 @@ extern void set_gdbarch_register_bytes_ok (struct gdbarch *gdbarch, gdbarch_regi
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Default (function) for non- multi-arch platforms. */
|
||||
#if (!GDB_MULTI_ARCH) && !defined (CANNOT_FETCH_REGISTER)
|
||||
#define CANNOT_FETCH_REGISTER(regnum) (cannot_register_not (regnum))
|
||||
#endif
|
||||
|
||||
typedef int (gdbarch_cannot_fetch_register_ftype) (int regnum);
|
||||
extern int gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, int regnum);
|
||||
extern void set_gdbarch_cannot_fetch_register (struct gdbarch *gdbarch, gdbarch_cannot_fetch_register_ftype *cannot_fetch_register);
|
||||
#if GDB_MULTI_ARCH
|
||||
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_FETCH_REGISTER)
|
||||
#define CANNOT_FETCH_REGISTER(regnum) (gdbarch_cannot_fetch_register (current_gdbarch, regnum))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Default (function) for non- multi-arch platforms. */
|
||||
#if (!GDB_MULTI_ARCH) && !defined (CANNOT_STORE_REGISTER)
|
||||
#define CANNOT_STORE_REGISTER(regnum) (cannot_register_not (regnum))
|
||||
#endif
|
||||
|
||||
typedef int (gdbarch_cannot_store_register_ftype) (int regnum);
|
||||
extern int gdbarch_cannot_store_register (struct gdbarch *gdbarch, int regnum);
|
||||
extern void set_gdbarch_cannot_store_register (struct gdbarch *gdbarch, gdbarch_cannot_store_register_ftype *cannot_store_register);
|
||||
#if GDB_MULTI_ARCH
|
||||
#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (CANNOT_STORE_REGISTER)
|
||||
#define CANNOT_STORE_REGISTER(regnum) (gdbarch_cannot_store_register (current_gdbarch, regnum))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch);
|
||||
extern void set_gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch, int use_generic_dummy_frames);
|
||||
#if GDB_MULTI_ARCH
|
||||
|
@ -429,6 +429,8 @@ f:2:DO_REGISTERS_INFO:void:do_registers_info:int reg_nr, int fpregs:reg_nr, fpre
|
||||
# also include/...-sim.h.
|
||||
f:2:REGISTER_SIM_REGNO:int:register_sim_regno:int reg_nr:reg_nr:::default_register_sim_regno::0
|
||||
F:2:REGISTER_BYTES_OK:int:register_bytes_ok:long nr_bytes:nr_bytes::0:0
|
||||
f:2:CANNOT_FETCH_REGISTER:int:cannot_fetch_register:int regnum:regnum:::cannot_register_not::0
|
||||
f:2:CANNOT_STORE_REGISTER:int:cannot_store_register:int regnum:regnum:::cannot_register_not::0
|
||||
#
|
||||
v:1:USE_GENERIC_DUMMY_FRAMES:int:use_generic_dummy_frames::::0:-1
|
||||
v:2:CALL_DUMMY_LOCATION:int:call_dummy_location::::0:0
|
||||
|
@ -349,11 +349,6 @@ _initialize_kernel_u_addr (void)
|
||||
- KERNEL_U_ADDR
|
||||
#endif
|
||||
|
||||
/* Registers we shouldn't try to fetch. */
|
||||
#if !defined (CANNOT_FETCH_REGISTER)
|
||||
#define CANNOT_FETCH_REGISTER(regno) 0
|
||||
#endif
|
||||
|
||||
/* Fetch one register. */
|
||||
|
||||
static void
|
||||
@ -418,11 +413,6 @@ fetch_inferior_registers (int regno)
|
||||
}
|
||||
}
|
||||
|
||||
/* Registers we shouldn't try to store. */
|
||||
#if !defined (CANNOT_STORE_REGISTER)
|
||||
#define CANNOT_STORE_REGISTER(regno) 0
|
||||
#endif
|
||||
|
||||
/* Store one register. */
|
||||
|
||||
static void
|
||||
|
@ -539,11 +539,6 @@ fetch_inferior_registers (int regno)
|
||||
If REGNO is -1, do this for all registers.
|
||||
Otherwise, REGNO specifies which register (so we can save time). */
|
||||
|
||||
/* Registers we shouldn't try to store. */
|
||||
#if !defined (CANNOT_STORE_REGISTER)
|
||||
#define CANNOT_STORE_REGISTER(regno) 0
|
||||
#endif
|
||||
|
||||
void
|
||||
store_inferior_registers (int regno)
|
||||
{
|
||||
|
@ -315,11 +315,6 @@ read_register_gen (int regnum, char *buf)
|
||||
/* Write register REGNUM at MYADDR to the target. MYADDR points at
|
||||
REGISTER_RAW_BYTES(REGNUM), which must be in target byte-order. */
|
||||
|
||||
/* Registers we shouldn't try to store. */
|
||||
#if !defined (CANNOT_STORE_REGISTER)
|
||||
#define CANNOT_STORE_REGISTER(regnum) 0
|
||||
#endif
|
||||
|
||||
static void
|
||||
legacy_write_register_gen (int regnum, char *myaddr)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user