Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc]: Get endianess from disassemble_info
@ 2008-02-19 19:29 Markus Deuling
  2008-02-19 23:18 ` Ulrich Weigand
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Deuling @ 2008-02-19 19:29 UTC (permalink / raw)
  To: GDB Patches; +Cc: Ulrich Weigand

[-- 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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-20 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-19 19:29 [rfc]: Get endianess from disassemble_info Markus Deuling
2008-02-19 23:18 ` Ulrich Weigand
2008-02-20 14:37   ` Markus Deuling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox