From 79dd2d2463b44e50d224eb94edd40942dc467611 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 27 Jan 2005 21:00:59 +0000 Subject: [PATCH] 2005-01-27 Andrew Cagney * 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. --- gdb/ChangeLog | 6 ++++++ gdb/gdbarch.c | 18 +++--------------- gdb/gdbarch.h | 25 +++---------------------- gdb/gdbarch.sh | 9 ++++----- gdb/mips-tdep.c | 5 +++-- gdb/value.c | 7 ++++--- 6 files changed, 23 insertions(+), 47 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 668c2adf688..4c430f6f27b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2005-01-27 Andrew Cagney + * 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. + * cli/cli-dump.h (fopen_with_cleanup): Make "filename" const. * cli/cli-dump.c (dump_binary_file, dump_bfd_file): Make string parameters const, change buf to a const bfd_byte. diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index c277e912eee..1db69c2396d 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -2,7 +2,7 @@ /* 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. @@ -1203,21 +1203,9 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file) fprintf_unfiltered (file, "gdbarch_dump: int_bit = %s\n", paddr_d (current_gdbarch->int_bit)); -#ifdef INTEGER_TO_ADDRESS_P - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INTEGER_TO_ADDRESS_P()", - XSTRING (INTEGER_TO_ADDRESS_P ())); -#endif fprintf_unfiltered (file, "gdbarch_dump: gdbarch_integer_to_address_p() = %d\n", gdbarch_integer_to_address_p (current_gdbarch)); -#ifdef INTEGER_TO_ADDRESS - fprintf_unfiltered (file, - "gdbarch_dump: %s # %s\n", - "INTEGER_TO_ADDRESS(type, buf)", - XSTRING (INTEGER_TO_ADDRESS (type, buf))); -#endif fprintf_unfiltered (file, "gdbarch_dump: integer_to_address = <0x%lx>\n", (long) current_gdbarch->integer_to_address); @@ -2714,13 +2702,13 @@ gdbarch_integer_to_address_p (struct gdbarch *gdbarch) } CORE_ADDR -gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) +gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const bfd_byte *buf) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->integer_to_address != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_integer_to_address called\n"); - return gdbarch->integer_to_address (type, buf); + return gdbarch->integer_to_address (gdbarch, type, buf); } void diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 4ab8ea50afa..5952ef12dbd 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -2,7 +2,7 @@ /* 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. @@ -747,30 +747,11 @@ extern void set_gdbarch_address_to_pointer (struct gdbarch *gdbarch, gdbarch_add #define ADDRESS_TO_POINTER(type, buf, addr) (gdbarch_address_to_pointer (current_gdbarch, type, buf, addr)) #endif -#if defined (INTEGER_TO_ADDRESS) -/* Legacy for systems yet to multi-arch INTEGER_TO_ADDRESS */ -#if !defined (INTEGER_TO_ADDRESS_P) -#define INTEGER_TO_ADDRESS_P() (1) -#endif -#endif - extern int gdbarch_integer_to_address_p (struct gdbarch *gdbarch); -#if !defined (GDB_TM_FILE) && defined (INTEGER_TO_ADDRESS_P) -#error "Non multi-arch definition of INTEGER_TO_ADDRESS" -#endif -#if !defined (INTEGER_TO_ADDRESS_P) -#define INTEGER_TO_ADDRESS_P() (gdbarch_integer_to_address_p (current_gdbarch)) -#endif -typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct type *type, void *buf); -extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf); +typedef CORE_ADDR (gdbarch_integer_to_address_ftype) (struct gdbarch *gdbarch, struct type *type, const bfd_byte *buf); +extern CORE_ADDR gdbarch_integer_to_address (struct gdbarch *gdbarch, struct type *type, const bfd_byte *buf); extern void set_gdbarch_integer_to_address (struct gdbarch *gdbarch, gdbarch_integer_to_address_ftype *integer_to_address); -#if !defined (GDB_TM_FILE) && defined (INTEGER_TO_ADDRESS) -#error "Non multi-arch definition of INTEGER_TO_ADDRESS" -#endif -#if !defined (INTEGER_TO_ADDRESS) -#define INTEGER_TO_ADDRESS(type, buf) (gdbarch_integer_to_address (current_gdbarch, type, buf)) -#endif /* NOTE: cagney/2003-03-24: Replaced by PUSH_ARGUMENTS. */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index aa0cd62cf25..1713defa7c4 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -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_info *frame, int regnum, struct type *ty # 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 <