[rfc]: Get endianess from disassemble_info

Markus Deuling
2008-02-19T19:29:46Z

[-- Attachment #1: Type: text/plain, Size: 534 bytes --]

Hi,

this patch replaces some current_gdbachs by getting the current endianess from disassemble_info
instead via a gdbarch callback.

Tested via gdb_buildall.sh and native on PowerPC without regression. Ok to commit ?

ChangeLog:

* rs6000-tdep.c (gdb_print_insn_powerpc): Get the current endianess
from disassemble_info instead of gdbarch_byte_order

* mips-tdep.c (gdb_print_insn_mips): Likewise.
* arm-tdep.c (gdb_print_insn_arm): Likewise.

--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com

[-- Attachment #2: diff-disasm --]
[-- Type: text/plain, Size: 1588 bytes --]

diff -urpN src/gdb/arm-tdep.c dev/gdb/arm-tdep.c
--- src/gdb/arm-tdep.c 2008-01-27 06:30:37.000000000 +0100
+++ dev/gdb/arm-tdep.c 2008-02-19 20:22:51.000000000 +0100
@@ -2018,7 +2018,7 @@ gdb_print_insn_arm (bfd_vma memaddr, dis
else
info->symbols = NULL;

- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (info->endian == BFD_ENDIAN_BIG)
return print_insn_big_arm (memaddr, info);
else
return print_insn_little_arm (memaddr, info);
diff -urpN src/gdb/mips-tdep.c dev/gdb/mips-tdep.c
--- src/gdb/mips-tdep.c 2008-01-11 14:20:52.000000000 +0100
+++ dev/gdb/mips-tdep.c 2008-02-19 20:21:15.000000000 +0100
@@ -4878,7 +4878,7 @@ gdb_print_insn_mips (bfd_vma memaddr, st
info->disassembler_options = "gpr-names=32";

/* Call the appropriate disassembler based on the target endian-ness. */
- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (info->endian == BFD_ENDIAN_BIG)
return print_insn_big_mips (memaddr, info);
else
return print_insn_little_mips (memaddr, info);
diff -urpN src/gdb/rs6000-tdep.c dev/gdb/rs6000-tdep.c
--- src/gdb/rs6000-tdep.c 2008-02-11 05:48:37.000000000 +0100
+++ dev/gdb/rs6000-tdep.c 2008-02-19 19:11:10.000000000 +0100
@@ -2929,7 +2929,7 @@ gdb_print_insn_powerpc (bfd_vma memaddr,
if (!info->disassembler_options)
info->disassembler_options = "any";

- if (gdbarch_byte_order (current_gdbarch) == BFD_ENDIAN_BIG)
+ if (info->endian == BFD_ENDIAN_BIG)
return print_insn_big_powerpc (memaddr, info);
else
return print_insn_little_powerpc (memaddr, info);