2004-06-09 Andrew Cagney <cagney@gnu.org>
+ * gdbarch.sh (DEPRECATED_REGISTER_CONVERT_TO_RAW)
+ (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
+ (DEPRECATED_REGISTER_CONVERTIBLE): Delete.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * infcmd.c (default_print_registers_info): Simplify.
+ * findvar.c (value_of_register): Simplify.
+ * mi/mi-main.c (get_register): Simplify.
+ * arch-utils.c (legacy_convert_register_p): Always return 0.
+ (legacy_register_to_value, legacy_value_to_register): Always call
+ internal_error.
+
* infptrace.c (child_xfer_memory) [CLEAR_INSN_CACHE]: Delete
#ifdef CLEAR_INSN_CACHE code.
* target.c (generic_mourn_inferior) [CLEAR_DEFERRED_STORES]:
int
legacy_convert_register_p (int regnum, struct type *type)
{
- return (DEPRECATED_REGISTER_CONVERTIBLE_P ()
- && DEPRECATED_REGISTER_CONVERTIBLE (regnum));
+ return 0;
}
void
legacy_register_to_value (struct frame_info *frame, int regnum,
struct type *type, void *to)
{
- char from[MAX_REGISTER_SIZE];
- get_frame_register (frame, regnum, from);
- DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to);
+ internal_error (__FILE__, __LINE__, "legacy_register_to_value called");
}
void
legacy_value_to_register (struct frame_info *frame, int regnum,
struct type *type, const void *tmp)
{
- char to[MAX_REGISTER_SIZE];
- char *from = alloca (TYPE_LENGTH (type));
- memcpy (from, from, TYPE_LENGTH (type));
- DEPRECATED_REGISTER_CONVERT_TO_RAW (type, regnum, from, to);
- put_frame_register (frame, regnum, to);
+ internal_error (__FILE__, __LINE__, "legacy_value_to_register called");
}
int
/* Convert raw data to virtual format if necessary. */
- if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
- && DEPRECATED_REGISTER_CONVERTIBLE (regnum))
- {
- DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, register_type (current_gdbarch, regnum),
- raw_buffer, VALUE_CONTENTS_RAW (reg_val));
- }
- else if (DEPRECATED_REGISTER_RAW_SIZE (regnum) == DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum))
+ if (DEPRECATED_REGISTER_RAW_SIZE (regnum) == DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum))
memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer,
DEPRECATED_REGISTER_RAW_SIZE (regnum));
else
gdbarch_deprecated_init_frame_pc_ftype *deprecated_init_frame_pc;
int believe_pcc_promotion;
gdbarch_deprecated_get_saved_register_ftype *deprecated_get_saved_register;
- gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible;
- gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual;
- gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw;
gdbarch_convert_register_p_ftype *convert_register_p;
gdbarch_register_to_value_ftype *register_to_value;
gdbarch_value_to_register_ftype *value_to_register;
0, /* deprecated_init_frame_pc */
0, /* believe_pcc_promotion */
0, /* deprecated_get_saved_register */
- 0, /* deprecated_register_convertible */
- 0, /* deprecated_register_convert_to_virtual */
- 0, /* deprecated_register_convert_to_raw */
0, /* convert_register_p */
0, /* register_to_value */
0, /* value_to_register */
/* Skip verify of deprecated_pc_in_call_dummy, has predicate */
/* Skip verify of deprecated_init_frame_pc, has predicate */
/* Skip verify of deprecated_get_saved_register, has predicate */
- /* Skip verify of deprecated_register_convertible, has predicate */
- /* Skip verify of deprecated_register_convert_to_virtual, invalid_p == 0 */
- /* Skip verify of deprecated_register_convert_to_raw, invalid_p == 0 */
/* Skip verify of convert_register_p, invalid_p == 0 */
/* Skip verify of register_to_value, invalid_p == 0 */
/* Skip verify of value_to_register, invalid_p == 0 */
"gdbarch_dump: DEPRECATED_REGISTER_BYTES = %d\n",
DEPRECATED_REGISTER_BYTES);
#endif
-#ifdef DEPRECATED_REGISTER_CONVERTIBLE_P
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_REGISTER_CONVERTIBLE_P()",
- XSTRING (DEPRECATED_REGISTER_CONVERTIBLE_P ()));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE_P() = %d\n",
- DEPRECATED_REGISTER_CONVERTIBLE_P ());
-#endif
-#ifdef DEPRECATED_REGISTER_CONVERTIBLE
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_REGISTER_CONVERTIBLE(nr)",
- XSTRING (DEPRECATED_REGISTER_CONVERTIBLE (nr)));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_CONVERTIBLE = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_convertible
- /*DEPRECATED_REGISTER_CONVERTIBLE ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_CONVERT_TO_RAW
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to)",
- XSTRING (DEPRECATED_REGISTER_CONVERT_TO_RAW (type, regnum, from, to)));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_RAW = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_convert_to_raw
- /*DEPRECATED_REGISTER_CONVERT_TO_RAW ()*/);
-#endif
-#ifdef DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL
- fprintf_unfiltered (file,
- "gdbarch_dump: %s # %s\n",
- "DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to)",
- XSTRING (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum, type, from, to)));
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL = <0x%08lx>\n",
- (long) current_gdbarch->deprecated_register_convert_to_virtual
- /*DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL ()*/);
-#endif
#ifdef DEPRECATED_REGISTER_RAW_SIZE_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
gdbarch->deprecated_get_saved_register = deprecated_get_saved_register;
}
-int
-gdbarch_deprecated_register_convertible_p (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- return gdbarch->deprecated_register_convertible != NULL;
-}
-
-int
-gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->deprecated_register_convertible != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convertible called\n");
- return gdbarch->deprecated_register_convertible (nr);
-}
-
-void
-set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch,
- gdbarch_deprecated_register_convertible_ftype deprecated_register_convertible)
-{
- gdbarch->deprecated_register_convertible = deprecated_register_convertible;
-}
-
-void
-gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->deprecated_register_convert_to_virtual != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_virtual called\n");
- gdbarch->deprecated_register_convert_to_virtual (regnum, type, from, to);
-}
-
-void
-set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch,
- gdbarch_deprecated_register_convert_to_virtual_ftype deprecated_register_convert_to_virtual)
-{
- gdbarch->deprecated_register_convert_to_virtual = deprecated_register_convert_to_virtual;
-}
-
-void
-gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->deprecated_register_convert_to_raw != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_convert_to_raw called\n");
- gdbarch->deprecated_register_convert_to_raw (type, regnum, from, to);
-}
-
-void
-set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch,
- gdbarch_deprecated_register_convert_to_raw_ftype deprecated_register_convert_to_raw)
-{
- gdbarch->deprecated_register_convert_to_raw = deprecated_register_convert_to_raw;
-}
-
int
gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type)
{
#define DEPRECATED_GET_SAVED_REGISTER(raw_buffer, optimized, addrp, frame, regnum, lval) (gdbarch_deprecated_get_saved_register (current_gdbarch, raw_buffer, optimized, addrp, frame, regnum, lval))
#endif
-/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
- For raw <-> cooked register conversions, replaced by pseudo registers. */
-
-#if defined (DEPRECATED_REGISTER_CONVERTIBLE)
-/* Legacy for systems yet to multi-arch DEPRECATED_REGISTER_CONVERTIBLE */
-#if !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
-#define DEPRECATED_REGISTER_CONVERTIBLE_P() (1)
-#endif
-#endif
-
-extern int gdbarch_deprecated_register_convertible_p (struct gdbarch *gdbarch);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE"
-#endif
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (DEPRECATED_REGISTER_CONVERTIBLE_P)
-#define DEPRECATED_REGISTER_CONVERTIBLE_P() (gdbarch_deprecated_register_convertible_p (current_gdbarch))
-#endif
-
-typedef int (gdbarch_deprecated_register_convertible_ftype) (int nr);
-extern int gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, int nr);
-extern void set_gdbarch_deprecated_register_convertible (struct gdbarch *gdbarch, gdbarch_deprecated_register_convertible_ftype *deprecated_register_convertible);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERTIBLE)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERTIBLE"
-#endif
-#if !defined (DEPRECATED_REGISTER_CONVERTIBLE)
-#define DEPRECATED_REGISTER_CONVERTIBLE(nr) (gdbarch_deprecated_register_convertible (current_gdbarch, nr))
-#endif
-
-/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
- For raw <-> cooked register conversions, replaced by pseudo registers. */
-
-typedef void (gdbarch_deprecated_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to);
-extern void gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to);
-extern void set_gdbarch_deprecated_register_convert_to_virtual (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_virtual_ftype *deprecated_register_convert_to_virtual);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL"
-#endif
-#if !defined (DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL)
-#define DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (gdbarch_deprecated_register_convert_to_virtual (current_gdbarch, regnum, type, from, to))
-#endif
-
-/* For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
- For raw <-> cooked register conversions, replaced by pseudo registers. */
-
-typedef void (gdbarch_deprecated_register_convert_to_raw_ftype) (struct type *type, int regnum, const char *from, char *to);
-extern void gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, const char *from, char *to);
-extern void set_gdbarch_deprecated_register_convert_to_raw (struct gdbarch *gdbarch, gdbarch_deprecated_register_convert_to_raw_ftype *deprecated_register_convert_to_raw);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_CONVERT_TO_RAW)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_CONVERT_TO_RAW"
-#endif
-#if !defined (DEPRECATED_REGISTER_CONVERT_TO_RAW)
-#define DEPRECATED_REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (gdbarch_deprecated_register_convert_to_raw (current_gdbarch, type, regnum, from, to))
-#endif
-
typedef int (gdbarch_convert_register_p_ftype) (int regnum, struct type *type);
extern int gdbarch_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type);
extern void set_gdbarch_convert_register_p (struct gdbarch *gdbarch, gdbarch_convert_register_p_ftype *convert_register_p);
v:2:BELIEVE_PCC_PROMOTION:int:believe_pcc_promotion:::::::
F:2:DEPRECATED_GET_SAVED_REGISTER:void:deprecated_get_saved_register:char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval:raw_buffer, optimized, addrp, frame, regnum, lval
#
-# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-# For raw <-> cooked register conversions, replaced by pseudo registers.
-F::DEPRECATED_REGISTER_CONVERTIBLE:int:deprecated_register_convertible:int nr:nr
-# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-# For raw <-> cooked register conversions, replaced by pseudo registers.
-f:2:DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL:void:deprecated_register_convert_to_virtual:int regnum, struct type *type, char *from, char *to:regnum, type, from, to:::0::0
-# For register <-> value conversions, replaced by CONVERT_REGISTER_P et.al.
-# For raw <-> cooked register conversions, replaced by pseudo registers.
-f:2:DEPRECATED_REGISTER_CONVERT_TO_RAW:void:deprecated_register_convert_to_raw:struct type *type, int regnum, const char *from, char *to:type, regnum, from, to:::0::0
-#
f:1:CONVERT_REGISTER_P:int:convert_register_p:int regnum, struct type *type:regnum, type::0:legacy_convert_register_p::0
f:1:REGISTER_TO_VALUE:void:register_to_value:struct frame_info *frame, int regnum, struct type *type, void *buf:frame, regnum, type, buf::0:legacy_register_to_value::0
f:1:VALUE_TO_REGISTER:void:value_to_register:struct frame_info *frame, int regnum, struct type *type, const void *buf:frame, regnum, type, buf::0:legacy_value_to_register::0
{
int i;
const int numregs = NUM_REGS + NUM_PSEUDO_REGS;
- char raw_buffer[MAX_REGISTER_SIZE];
- char virtual_buffer[MAX_REGISTER_SIZE];
+ char buffer[MAX_REGISTER_SIZE];
if (DEPRECATED_DO_REGISTERS_INFO_P ())
{
print_spaces_filtered (15 - strlen (REGISTER_NAME (i)), file);
/* Get the data in raw format. */
- if (! frame_register_read (frame, i, raw_buffer))
+ if (! frame_register_read (frame, i, buffer))
{
fprintf_filtered (file, "*value not available*\n");
continue;
}
- /* FIXME: cagney/2002-08-03: This code shouldn't be necessary.
- The function frame_register_read() should have returned the
- pre-cooked register so no conversion is necessary. */
- /* Convert raw data to virtual format if necessary. */
- if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
- && DEPRECATED_REGISTER_CONVERTIBLE (i))
- {
- DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (i, register_type (current_gdbarch, i),
- raw_buffer, virtual_buffer);
- }
- else
- {
- memcpy (virtual_buffer, raw_buffer,
- DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
- }
-
/* If virtual format is floating, print it that way, and in raw
hex. */
if (TYPE_CODE (register_type (current_gdbarch, i)) == TYPE_CODE_FLT)
{
int j;
- val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0,
+ val_print (register_type (current_gdbarch, i), buffer, 0, 0,
file, 0, 1, 0, Val_pretty_default);
fprintf_filtered (file, "\t(raw 0x");
idx = j;
else
idx = DEPRECATED_REGISTER_RAW_SIZE (i) - 1 - j;
- fprintf_filtered (file, "%02x", (unsigned char) raw_buffer[idx]);
+ fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]);
}
fprintf_filtered (file, ")");
}
else
{
/* Print the register in hex. */
- val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0,
+ val_print (register_type (current_gdbarch, i), buffer, 0, 0,
file, 'x', 1, 0, Val_pretty_default);
/* If not a vector register, print it also according to its
natural format. */
if (TYPE_VECTOR (register_type (current_gdbarch, i)) == 0)
{
fprintf_filtered (file, "\t");
- val_print (register_type (current_gdbarch, i), virtual_buffer, 0, 0,
+ val_print (register_type (current_gdbarch, i), buffer, 0, 0,
file, 0, 1, 0, Val_pretty_default);
}
}
static int
get_register (int regnum, int format)
{
- char raw_buffer[MAX_REGISTER_SIZE];
- char virtual_buffer[MAX_REGISTER_SIZE];
+ char buffer[MAX_REGISTER_SIZE];
int optim;
int realnum;
CORE_ADDR addr;
format = 0;
frame_register (deprecated_selected_frame, regnum, &optim, &lval, &addr,
- &realnum, raw_buffer);
+ &realnum, buffer);
if (optim)
{
return -1;
}
- /* Convert raw data to virtual format if necessary. */
-
- if (DEPRECATED_REGISTER_CONVERTIBLE_P ()
- && DEPRECATED_REGISTER_CONVERTIBLE (regnum))
- {
- DEPRECATED_REGISTER_CONVERT_TO_VIRTUAL (regnum,
- register_type (current_gdbarch, regnum),
- raw_buffer, virtual_buffer);
- }
- else
- memcpy (virtual_buffer, raw_buffer, DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
-
if (format == 'r')
{
int j;
{
int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
: DEPRECATED_REGISTER_RAW_SIZE (regnum) - 1 - j;
- sprintf (ptr, "%02x", (unsigned char) raw_buffer[idx]);
+ sprintf (ptr, "%02x", (unsigned char) buffer[idx]);
ptr += 2;
}
ui_out_field_string (uiout, "value", buf);
}
else
{
- val_print (register_type (current_gdbarch, regnum), virtual_buffer, 0, 0,
+ val_print (register_type (current_gdbarch, regnum), buffer, 0, 0,
stb->stream, format, 1, 0, Val_pretty_default);
ui_out_field_stream (uiout, "value", stb);
ui_out_stream_delete (stb);