aboutsummaryrefslogtreecommitdiff
path: root/gdb/sp64-tdep.c
diff options
context:
space:
mode:
authorDavid Edelsohn <dje.gcc@gmail.com>1993-07-30 18:57:41 +0000
committerDavid Edelsohn <dje.gcc@gmail.com>1993-07-30 18:57:41 +0000
commitb562a1861c2c19b5639f13ff5e48de26caabd23a (patch)
treec84bb8405b56383c735097e4408f058d22b4c69e /gdb/sp64-tdep.c
parent9be4f7b466a746abf0e846960dec4c7a31c1ce51 (diff)
downloadgdb-b562a1861c2c19b5639f13ff5e48de26caabd23a.zip
gdb-b562a1861c2c19b5639f13ff5e48de26caabd23a.tar.gz
gdb-b562a1861c2c19b5639f13ff5e48de26caabd23a.tar.bz2
remote-sim.h: New file.
remote-sp64sim.h (sim_*): External fns. (simif_*): Internal fns. sp64-tdep.c (sparc64_frame_chain, sparc64_frame_saved_pc): Deleted. (dump_ccreg, sparc_print_register_hook): New fns.
Diffstat (limited to 'gdb/sp64-tdep.c')
-rw-r--r--gdb/sp64-tdep.c93
1 files changed, 40 insertions, 53 deletions
diff --git a/gdb/sp64-tdep.c b/gdb/sp64-tdep.c
index d202e25..c6c4a8e 100644
--- a/gdb/sp64-tdep.c
+++ b/gdb/sp64-tdep.c
@@ -132,29 +132,6 @@ sparc64_single_step (ignore)
}
}
-/* FIXME: sparc64_frame_chain() is temporary. sparc_frame_chain() can
- be fixed to support both of us. */
-
-#define FRAME_SAVED_L0 0 /* Byte offset from SP */
-#define FRAME_SAVED_I0 (8*REGISTER_RAW_SIZE (0)) /* Byte offset from SP */
-
-CORE_ADDR
-sparc64_frame_chain (thisframe)
- FRAME thisframe;
-{
- REGISTER_TYPE retval;
- int err;
- CORE_ADDR addr;
-
- addr = thisframe->frame + FRAME_SAVED_I0 +
- REGISTER_RAW_SIZE (0) * (FP_REGNUM - I0_REGNUM);
- err = target_read_memory (addr, (char *) &retval, sizeof (REGISTER_TYPE));
- if (err)
- return 0;
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
- return retval;
-}
-
CORE_ADDR
sparc64_extract_struct_value_address (regbuf)
char regbuf[REGISTER_BYTES];
@@ -166,36 +143,6 @@ sparc64_extract_struct_value_address (regbuf)
return addr;
}
-/* Find the pc saved in frame FRAME. */
-/* FIXME: This function can be removed when sparc_frame_saved_pc
- handles us too. */
-
-CORE_ADDR
-sparc64_frame_saved_pc (frame)
- FRAME frame;
-{
- int err;
- REGISTER_TYPE retval;
- CORE_ADDR addr,prev_pc;
-
- if (get_current_frame () == frame) /* FIXME, debug check. Remove >=gdb-4.6 */
- {
- if (read_register (SP_REGNUM) != frame->bottom) abort();
- }
-
- addr = frame->bottom + FRAME_SAVED_I0 +
- REGISTER_RAW_SIZE (0) * (I7_REGNUM - I0_REGNUM);
- err = target_read_memory (addr, (char *) &retval, sizeof (REGISTER_TYPE));
- if (err)
- return 0;
- SWAP_TARGET_AND_HOST (&retval, sizeof (retval));
-
- /* CORE_ADDR isn't always the same size as REGISTER_TYPE, so convert. */
-
- prev_pc = (CORE_ADDR) retval;
- return PC_ADJUST (prev_pc);
-}
-
/* Check instruction at ADDR to see if it is an annulled branch or other
instruction whose npc isn't pc+4 (eg: trap, done, retry).
All other instructions will go to NPC or will trap.
@@ -301,6 +248,46 @@ isbranch (instruction, addr, target)
return val;
}
+/* PRINT_REGISTER_HOOK routine.
+ Pretty print various registers. */
+
+static void
+dump_ccreg (reg, val)
+ char *reg;
+ int val;
+{
+ printf ("%s:%s,%s,%s,%s", reg,
+ val & 8 ? "N" : "NN",
+ val & 4 ? "Z" : "NZ",
+ val & 2 ? "O" : "NO",
+ val & 1 ? "C" : "NC"
+ );
+}
+
+void
+sparc_print_register_hook (regno)
+ int regno;
+{
+ if (((unsigned) (regno) - FP0_REGNUM < FP_MAX_REGNUM - FP0_REGNUM)
+ && ((regno) & 1) == 0)
+ {
+ char doublereg[8]; /* two float regs */
+ if (!read_relative_register_raw_bytes ((regno), doublereg))
+ {
+ printf("\t");
+ print_floating (doublereg, builtin_type_double, stdout);
+ }
+ }
+ else if ((regno) == CCR_REGNUM)
+ {
+ int ccr = read_register (CCR_REGNUM);
+ printf("\t");
+ dump_ccreg ("xcc", ccr >> 4);
+ printf(", ");
+ dump_ccreg ("icc", ccr & 15);
+ }
+}
+
/* We try to support 32 bit and 64 bit pointers.
We are called when the Shade target is selected by shadeif.c. */