aboutsummaryrefslogtreecommitdiff
path: root/gdb/rs6000-tdep.c
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>1995-06-06 14:49:32 +0000
committerMichael Meissner <gnu@the-meissners.org>1995-06-06 14:49:32 +0000
commit5c172b4bfde5f6aab86afa5441ef849b3e95ab2e (patch)
tree612d3d66e31db365085450971abdd2f898457517 /gdb/rs6000-tdep.c
parent4a442536378bd8a91aef82fb33f294c4e602c5d2 (diff)
downloadgdb-5c172b4bfde5f6aab86afa5441ef849b3e95ab2e.zip
gdb-5c172b4bfde5f6aab86afa5441ef849b3e95ab2e.tar.gz
gdb-5c172b4bfde5f6aab86afa5441ef849b3e95ab2e.tar.bz2
Fix some little endian problems
Diffstat (limited to 'gdb/rs6000-tdep.c')
-rw-r--r--gdb/rs6000-tdep.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index e6e31aa..89c3ddd 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -126,7 +126,9 @@ single_step (signal)
{
#define INSNLEN(OPCODE) 4
- static char breakp[] = BREAKPOINT;
+ static char le_breakp[] = LITTLE_BREAKPOINT;
+ static char be_breakp[] = BIG_BREAKPOINT;
+ char *breakp = TARGET_BYTE_ORDER == BIG_ENDIAN ? be_breakp : le_breakp;
int ii, insn;
CORE_ADDR loc;
CORE_ADDR breaks[2];
@@ -1221,12 +1223,25 @@ find_toc_address (pc)
return loadinfo[toc_entry].dataorg + loadinfo[toc_entry].toc_offset;
}
+#ifdef GDB_TARGET_POWERPC
+int
+gdb_print_insn_powerpc (memaddr, info)
+ bfd_vma memaddr;
+ disassemble_info *info;
+{
+ if (TARGET_BYTE_ORDER == BIG_ENDIAN)
+ return print_insn_big_powerpc (memaddr, info);
+ else
+ return print_insn_little_powerpc (memaddr, info);
+}
+#endif
+
void
_initialize_rs6000_tdep ()
{
/* FIXME, this should not be decided via ifdef. */
#ifdef GDB_TARGET_POWERPC
- tm_print_insn = print_insn_big_powerpc;
+ tm_print_insn = gdb_print_insn_powerpc;
#else
tm_print_insn = print_insn_rs6000;
#endif