This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Make integer_to_address multi-arch / const
- From: Andrew Cagney <cagney at gnu dot org>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 27 Jan 2005 16:01:22 -0500
- Subject: [commit] Make integer_to_address multi-arch / const
FYI, more cleanup.
committed,
Andrew
2005-01-27 Andrew Cagney <cagney@gnu.org>
* gdbarch.sh (integer_to_address): Change buf parameter to a const
bfd_byte, make pure-multi-arch.
* gdbarch.h, gdbarch.c: Regenerate.
* mips-tdep.c (mips_integer_to_address): Update.
* value.c (value_as_address): Update.
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.352
diff -p -u -r1.352 gdbarch.sh
--- gdbarch.sh 3 Dec 2004 23:59:52 -0000 1.352
+++ gdbarch.sh 27 Jan 2005 20:59:49 -0000
@@ -2,9 +2,8 @@
# Architecture commands for GDB, the GNU debugger.
#
-# Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
-# Foundation, Inc.
-#
+# Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
+# Software Foundation, Inc.
#
# This file is part of GDB.
#
@@ -500,7 +499,7 @@ f:=:void:value_to_register:struct frame_
#
f:=:CORE_ADDR:pointer_to_address:struct type *type, const void *buf:type, buf::unsigned_pointer_to_address::0
f:=:void:address_to_pointer:struct type *type, void *buf, CORE_ADDR addr:type, buf, addr::unsigned_address_to_pointer::0
-F:=:CORE_ADDR:integer_to_address:struct type *type, void *buf:type, buf
+M::CORE_ADDR:integer_to_address:struct type *type, const bfd_byte *buf:type, buf
#
# NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS.
F:=:void:deprecated_store_struct_return:CORE_ADDR addr, CORE_ADDR sp:addr, sp
@@ -714,7 +713,7 @@ cat <<EOF
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free
Software Foundation, Inc.
This file is part of GDB.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.365
diff -p -u -r1.365 mips-tdep.c
--- mips-tdep.c 5 Jan 2005 15:43:44 -0000 1.365
+++ mips-tdep.c 27 Jan 2005 20:59:49 -0000
@@ -1,7 +1,7 @@
/* Target-dependent code for the MIPS architecture, for GDB, the GNU Debugger.
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software
Foundation, Inc.
Contributed by Alessandro Forin(af@cs.cmu.edu) at CMU
@@ -4596,7 +4596,8 @@ mips_register_sim_regno (int regnum)
guarenteed to be correctly sign extended. */
static CORE_ADDR
-mips_integer_to_address (struct type *type, void *buf)
+mips_integer_to_address (struct gdbarch *gdbarch,
+ struct type *type, const bfd_byte *buf)
{
char *tmp = alloca (TYPE_LENGTH (builtin_type_void_data_ptr));
LONGEST val = unpack_long (type, buf);
Index: value.c
===================================================================
RCS file: /cvs/src/src/gdb/value.c,v
retrieving revision 1.5
diff -p -u -r1.5 value.c
--- value.c 15 Nov 2004 22:17:59 -0000 1.5
+++ value.c 27 Jan 2005 20:59:50 -0000
@@ -654,7 +654,7 @@ value_as_address (struct value *val)
take an address from a disassembly listing and give it to `x/i'.
This is certainly important.
- Adding an architecture method like INTEGER_TO_ADDRESS certainly
+ Adding an architecture method like integer_to_address() certainly
makes it possible for GDB to "get it right" in all circumstances
--- the target has complete control over how things get done, so
people can Do The Right Thing for their target without breaking
@@ -664,8 +664,9 @@ value_as_address (struct value *val)
if (TYPE_CODE (value_type (val)) != TYPE_CODE_PTR
&& TYPE_CODE (value_type (val)) != TYPE_CODE_REF
- && INTEGER_TO_ADDRESS_P ())
- return INTEGER_TO_ADDRESS (value_type (val), VALUE_CONTENTS (val));
+ && gdbarch_integer_to_address_p (current_gdbarch))
+ return gdbarch_integer_to_address (current_gdbarch, value_type (val),
+ VALUE_CONTENTS (val));
return unpack_long (value_type (val), VALUE_CONTENTS (val));
#endif