From: Markus Deuling <deuling@de.ibm.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Ulrich Weigand <uweigand@de.ibm.com>
Subject: [rfc] [4/6] Replace DEPRECATED_REGISTER_SIZE
Date: Mon, 18 Jun 2007 09:03:00 -0000 [thread overview]
Message-ID: <46764A23.7020101@de.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 419 bytes --]
Hello,
this patch replaces DEPRECATED_REGISTER_SIZE by gdbarch_deprecated_register_size
ChangeLog:
* gdbarch.sh (DEPRECATED_REGISTER_SIZE): Replace by
gdbarch_deprecated_register_size.
* arm-tdep.c (arm_push_dummy_call, thumb_get_next_pc)
(arm_return_in_memory): Likewise.
* gdbarch.c, gdbarch.h: Regenerate.
Is this ok to commit ?
--
Markus Deuling
GNU Toolchain for Linux on Cell BE
deuling@de.ibm.com
[-- Attachment #2: diff-remove-REGISTER_SIZE --]
[-- Type: text/plain, Size: 6123 bytes --]
diff -urN src/gdb/arm-tdep.c dev/gdb/arm-tdep.c
--- src/gdb/arm-tdep.c 2007-06-18 05:36:40.000000000 +0200
+++ dev/gdb/arm-tdep.c 2007-06-18 10:06:09.000000000 +0200
@@ -1282,7 +1282,9 @@
registers and stack. */
while (len > 0)
{
- int partial_len = len < DEPRECATED_REGISTER_SIZE ? len : DEPRECATED_REGISTER_SIZE;
+ int partial_len
+ = len < gdbarch_deprecated_register_size (current_gdbarch)
+ ? len : gdbarch_deprecated_register_size (current_gdbarch);
if (argreg <= ARM_LAST_ARG_REGNUM)
{
@@ -1294,7 +1296,9 @@
argnum,
gdbarch_register_name
(current_gdbarch, argreg),
- phex (regval, DEPRECATED_REGISTER_SIZE));
+ phex (regval,
+ gdbarch_deprecated_register_size
+ (current_gdbarch)));
regcache_cooked_write_unsigned (regcache, argreg, regval);
argreg++;
}
@@ -1304,8 +1308,10 @@
if (arm_debug)
fprintf_unfiltered (gdb_stdlog, "arg %d @ sp + %d\n",
argnum, nstack);
- si = push_stack_item (si, val, DEPRECATED_REGISTER_SIZE);
- nstack += DEPRECATED_REGISTER_SIZE;
+ si = push_stack_item (si, val,
+ gdbarch_deprecated_register_size
+ (current_gdbarch));
+ nstack += gdbarch_deprecated_register_size (current_gdbarch);
}
len -= partial_len;
@@ -1622,7 +1628,8 @@
/* Fetch the saved PC from the stack. It's stored above
all of the other registers. */
- offset = bitcount (bits (inst1, 0, 7)) * DEPRECATED_REGISTER_SIZE;
+ offset = bitcount (bits (inst1, 0, 7))
+ * gdbarch_deprecated_register_size (current_gdbarch);
sp = get_frame_register_unsigned (frame, ARM_SP_REGNUM);
nextpc = (CORE_ADDR) read_memory_unsigned_integer (sp + offset, 4);
nextpc = gdbarch_addr_bits_remove (current_gdbarch, nextpc);
@@ -2138,7 +2145,7 @@
/* In the ARM ABI, "integer" like aggregate types are returned in
registers. For an aggregate type to be integer like, its size
- must be less than or equal to DEPRECATED_REGISTER_SIZE and the
+ must be less than or equal to gdbarch_deprecated_register_size and the
offset of each addressable subfield must be zero. Note that bit
fields are not addressable, and all addressable subfields of
unions always start at offset zero.
@@ -2155,7 +2162,7 @@
/* All aggregate types that won't fit in a register must be returned
in memory. */
- if (TYPE_LENGTH (type) > DEPRECATED_REGISTER_SIZE)
+ if (TYPE_LENGTH (type) > gdbarch_deprecated_register_size (current_gdbarch))
{
return 1;
}
@@ -2182,7 +2189,7 @@
int i;
/* Need to check if this struct/union is "integer" like. For
this to be true, its size must be less than or equal to
- DEPRECATED_REGISTER_SIZE and the offset of each addressable
+ gdbarch_deprecated_register_size and the offset of each addressable
subfield must be zero. Note that bit fields are not
addressable, and unions always start at offset zero. If any
of the subfields is a floating point type, the struct/union
diff -urN src/gdb/gdbarch.c dev/gdb/gdbarch.c
--- src/gdb/gdbarch.c 2007-06-18 05:36:42.000000000 +0200
+++ dev/gdb/gdbarch.c 2007-06-18 10:02:08.000000000 +0200
@@ -777,11 +777,6 @@
fprintf_unfiltered (file,
"gdbarch_dump: deprecated_reg_struct_has_addr = <0x%lx>\n",
(long) current_gdbarch->deprecated_reg_struct_has_addr);
-#ifdef DEPRECATED_REGISTER_SIZE
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_SIZE # %s\n",
- XSTRING (DEPRECATED_REGISTER_SIZE));
-#endif
fprintf_unfiltered (file,
"gdbarch_dump: deprecated_register_size = %s\n",
paddr_d (current_gdbarch->deprecated_register_size));
diff -urN src/gdb/gdbarch.h dev/gdb/gdbarch.h
--- src/gdb/gdbarch.h 2007-06-18 05:36:42.000000000 +0200
+++ dev/gdb/gdbarch.h 2007-06-18 10:01:58.000000000 +0200
@@ -300,16 +300,10 @@
extern CORE_ADDR gdbarch_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr);
extern void set_gdbarch_push_dummy_call (struct gdbarch *gdbarch, gdbarch_push_dummy_call_ftype *push_dummy_call);
-/* DEPRECATED_REGISTER_SIZE can be deleted. */
+/* deprecated_register_size can be deleted. */
extern int gdbarch_deprecated_register_size (struct gdbarch *gdbarch);
extern void set_gdbarch_deprecated_register_size (struct gdbarch *gdbarch, int deprecated_register_size);
-#if !defined (GDB_TM_FILE) && defined (DEPRECATED_REGISTER_SIZE)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_SIZE"
-#endif
-#if !defined (DEPRECATED_REGISTER_SIZE)
-#define DEPRECATED_REGISTER_SIZE (gdbarch_deprecated_register_size (current_gdbarch))
-#endif
extern int gdbarch_call_dummy_location (struct gdbarch *gdbarch);
extern void set_gdbarch_call_dummy_location (struct gdbarch *gdbarch, int call_dummy_location);
diff -urN src/gdb/gdbarch.sh dev/gdb/gdbarch.sh
--- src/gdb/gdbarch.sh 2007-06-18 05:36:42.000000000 +0200
+++ dev/gdb/gdbarch.sh 2007-06-18 10:01:53.000000000 +0200
@@ -467,8 +467,8 @@
# See gdbint.texinfo. See infcall.c.
M::CORE_ADDR:push_dummy_call:struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr:function, regcache, bp_addr, nargs, args, sp, struct_return, struct_addr
-# DEPRECATED_REGISTER_SIZE can be deleted.
-v:=:int:deprecated_register_size
+# deprecated_register_size can be deleted.
+v::int:deprecated_register_size
v::int:call_dummy_location::::AT_ENTRY_POINT::0
M::CORE_ADDR:push_dummy_code:CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc, struct value **args, int nargs, struct type *value_type, CORE_ADDR *real_pc, CORE_ADDR *bp_addr, struct regcache *regcache:sp, funaddr, using_gcc, args, nargs, value_type, real_pc, bp_addr, regcache
next reply other threads:[~2007-06-18 9:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-18 9:03 Markus Deuling [this message]
2007-06-18 19:01 ` Ulrich Weigand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46764A23.7020101@de.ibm.com \
--to=deuling@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox