This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed] MIPS: Code structure improvements
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Tue, 24 Apr 2012 20:44:23 +0100
- Subject: [committed] MIPS: Code structure improvements
Hi,
I have applied this change to group pieces of code in a more consistent
way, in particular the MIPS16 helpers seen in this change are now next to
some other ones and this in turned has coupled some ISA/ABI helpers
together as well. No functional changes.
2012-04-24 Maciej W. Rozycki <macro@codesourcery.com>
gdb/
* mips-tdep.c
(is_mips16_addr, unmake_mips16_addr, make_mips16_addr): Group
with the other MIPS16 helpers.
Maciej
gdb-mips16-helpers-group.diff
Index: gdb-fsf-trunk-quilt/gdb/mips-tdep.c
===================================================================
--- gdb-fsf-trunk-quilt.orig/gdb/mips-tdep.c 2012-04-23 23:05:44.000000000 +0100
+++ gdb-fsf-trunk-quilt/gdb/mips-tdep.c 2012-04-23 23:11:02.175561146 +0100
@@ -203,27 +203,6 @@ mips_float_register_p (struct gdbarch *g
#define MIPS_FPU_TYPE(gdbarch) (gdbarch_tdep (gdbarch)->mips_fpu_type)
-/* MIPS16 function addresses are odd (bit 0 is set). Here are some
- functions to test, set, or clear bit 0 of addresses. */
-
-static CORE_ADDR
-is_mips16_addr (CORE_ADDR addr)
-{
- return ((addr) & 1);
-}
-
-static CORE_ADDR
-unmake_mips16_addr (CORE_ADDR addr)
-{
- return ((addr) & ~(CORE_ADDR) 1);
-}
-
-static CORE_ADDR
-make_mips16_addr (CORE_ADDR addr)
-{
- return ((addr) | (CORE_ADDR) 1);
-}
-
/* Return the MIPS ABI associated with GDBARCH. */
enum mips_abi
mips_abi (struct gdbarch *gdbarch)
@@ -267,6 +246,27 @@ mips_abi_regsize (struct gdbarch *gdbarc
}
}
+/* MIPS16 function addresses are odd (bit 0 is set). Here are some
+ functions to test, set, or clear bit 0 of addresses. */
+
+static CORE_ADDR
+is_mips16_addr (CORE_ADDR addr)
+{
+ return ((addr) & 1);
+}
+
+static CORE_ADDR
+unmake_mips16_addr (CORE_ADDR addr)
+{
+ return ((addr) & ~(CORE_ADDR) 1);
+}
+
+static CORE_ADDR
+make_mips16_addr (CORE_ADDR addr)
+{
+ return ((addr) | (CORE_ADDR) 1);
+}
+
/* Functions for setting and testing a bit in a minimal symbol that
marks it as 16-bit function. The MSB of the minimal symbol's
"info" field is used for this purpose.