(SMASH_TEXT_ADDRESS): Add rule.
*gdbarch.h, gdbarch.c: Re-generate.
* coffread.c: Multi-arch uses of SMASH_TEXT_ADDRESS.
* dbxread.c: Likewise.
* dwarfread.c: Likewise.
* elfread.c: Likewise.
* somread.c: Likewise.
* arm-tdep.c (arm_smash_text_address): New function.
* config/arm/tm-arm.h (SMASH_TEXT_ADDRESS): Define in terms of above.
+2002-02-04 Richard Earnshaw <rearnsha@arm.com>
+
+ * gdbarch.sh (copyright): Update years in generated header.
+ (SMASH_TEXT_ADDRESS): Add rule.
+ *gdbarch.h, gdbarch.c: Re-generate.
+ * coffread.c: Multi-arch uses of SMASH_TEXT_ADDRESS.
+ * dbxread.c: Likewise.
+ * dwarfread.c: Likewise.
+ * elfread.c: Likewise.
+ * somread.c: Likewise.
+
+ * arm-tdep.c (arm_smash_text_address): New function.
+ * config/arm/tm-arm.h (SMASH_TEXT_ADDRESS): Define in terms of above.
+
2002-02-04 Pierre Muller <muller@ics.u-strasbg.fr>
Add support for hardware watchpoints on win32 native.
return 0;
}
+/* Remove useless bits from addresses in a running program. */
CORE_ADDR
arm_addr_bits_remove (CORE_ADDR val)
{
return (val & (arm_apcs_32 ? 0xfffffffc : 0x03fffffc));
}
+/* When reading symbols, we need to zap the low bit of the address,
+ which may be set to 1 for Thumb functions. */
+CORE_ADDR
+arm_smash_text_address (CORE_ADDR val)
+{
+ return val & ~1;
+}
+
CORE_ADDR
arm_saved_pc_after_call (struct frame_info *frame)
{
/* Read coff symbol tables and convert to internal format, for GDB.
Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001
+ 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
cs->c_sclass == C_EXT || cs->c_sclass == C_THUMBEXTFUNC
|| cs->c_sclass == C_THUMBEXT ?
mst_text : mst_file_text;
-#ifdef SMASH_TEXT_ADDRESS
- if (tmpaddr & 1) /* FIXME: delete this line */
- SMASH_TEXT_ADDRESS (tmpaddr);
-#endif
+ tmpaddr = SMASH_TEXT_ADDRESS (tmpaddr);
}
else if (sec == SECT_OFF_DATA (objfile))
{
? &floatformat_ieee_double_big \
: &floatformat_ieee_double_littlebyte_bigword)
-/* When reading symbols, we need to zap the low bit of the address,
- which may be set to 1 for Thumb functions. */
-
-#define SMASH_TEXT_ADDRESS(addr) ((addr) &= ~0x1)
-
-/* Remove useless bits from addresses in a running program. */
+CORE_ADDR arm_smash_text_address(CORE_ADDR);
+#define SMASH_TEXT_ADDRESS(ADDR) arm_smash_text_address (ADDR)
CORE_ADDR arm_addr_bits_remove (CORE_ADDR);
-
-#define ADDR_BITS_REMOVE(val) (arm_addr_bits_remove (val))
+#define ADDR_BITS_REMOVE(VAL) arm_addr_bits_remove (VAL)
/* Offset from address of function to start of its code. Zero on most
machines. */
/* Read dbx symbol tables and convert to internal format, for GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
/* Relocate for dynamic loading */
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (valu);
-#endif
+ valu = SMASH_TEXT_ADDRESS (valu);
goto define_a_symbol;
case N_LBRAC:
/* DWARF debugging format support for GDB.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001
+ 2001, 2002
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support. Portions based on dbxread.c,
mipsread.c, coffread.c, and dwarfread.c from a Data General SVR4 gdb port.
{
nextdie = thisdie + di.die_length;
}
-#ifdef SMASH_TEXT_ADDRESS
/* I think that these are always text, not data, addresses. */
- SMASH_TEXT_ADDRESS (di.at_low_pc);
- SMASH_TEXT_ADDRESS (di.at_high_pc);
-#endif
+ di.at_low_pc = SMASH_TEXT_ADDRESS (di.at_low_pc);
+ di.at_high_pc = SMASH_TEXT_ADDRESS (di.at_high_pc);
switch (di.die_tag)
{
case TAG_compile_unit:
/* Read ELF (Executable and Linking Format) object files for GDB.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001
+ 2001, 2002
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
enum minimal_symbol_type ms_type, char *info, /* FIXME, is this really char *? */
asection *bfd_section, struct objfile *objfile)
{
-#ifdef SMASH_TEXT_ADDRESS
if (ms_type == mst_text || ms_type == mst_file_text)
- SMASH_TEXT_ADDRESS (address);
-#endif
+ address = SMASH_TEXT_ADDRESS (address);
return prim_record_minimal_symbol_and_info
(name, address, ms_type, info, bfd_section->index, bfd_section, objfile);
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
const struct floatformat * long_double_format;
gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
gdbarch_addr_bits_remove_ftype *addr_bits_remove;
+ gdbarch_smash_text_address_ftype *smash_text_address;
gdbarch_software_single_step_ftype *software_single_step;
gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
0,
0,
0,
+ 0,
generic_in_function_epilogue_p,
construct_inferior_arguments,
0,
current_gdbarch->extra_stack_alignment_needed = 1;
current_gdbarch->convert_from_func_ptr_addr = core_addr_identity;
current_gdbarch->addr_bits_remove = core_addr_identity;
+ current_gdbarch->smash_text_address = core_addr_identity;
current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
gdbarch->long_double_format = &floatformat_unknown;
/* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
/* Skip verify of addr_bits_remove, invalid_p == 0 */
+ /* Skip verify of smash_text_address, invalid_p == 0 */
/* Skip verify of software_single_step, has predicate */
/* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
(long) current_gdbarch->skip_trampoline_code
/*SKIP_TRAMPOLINE_CODE ()*/);
#endif
+#ifdef SMASH_TEXT_ADDRESS
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SMASH_TEXT_ADDRESS(addr)",
+ XSTRING (SMASH_TEXT_ADDRESS (addr)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SMASH_TEXT_ADDRESS = 0x%08lx\n",
+ (long) current_gdbarch->smash_text_address
+ /*SMASH_TEXT_ADDRESS ()*/);
+#endif
#ifdef SOFTWARE_SINGLE_STEP
#if GDB_MULTI_ARCH
/* Macro might contain `[{}]' when not multi-arch */
gdbarch->addr_bits_remove = addr_bits_remove;
}
+CORE_ADDR
+gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ if (gdbarch->smash_text_address == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_smash_text_address invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_smash_text_address called\n");
+ return gdbarch->smash_text_address (addr);
+}
+
+void
+set_gdbarch_smash_text_address (struct gdbarch *gdbarch,
+ gdbarch_smash_text_address_ftype smash_text_address)
+{
+ gdbarch->smash_text_address = smash_text_address;
+}
+
int
gdbarch_software_single_step_p (struct gdbarch *gdbarch)
{
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
#endif
#endif
+/* It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
+ ADDR_BITS_REMOVE. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (SMASH_TEXT_ADDRESS)
+#define SMASH_TEXT_ADDRESS(addr) (core_addr_identity (addr))
+#endif
+
+typedef CORE_ADDR (gdbarch_smash_text_address_ftype) (CORE_ADDR addr);
+extern CORE_ADDR gdbarch_smash_text_address (struct gdbarch *gdbarch, CORE_ADDR addr);
+extern void set_gdbarch_smash_text_address (struct gdbarch *gdbarch, gdbarch_smash_text_address_ftype *smash_text_address);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SMASH_TEXT_ADDRESS)
+#error "Non multi-arch definition of SMASH_TEXT_ADDRESS"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (SMASH_TEXT_ADDRESS)
+#define SMASH_TEXT_ADDRESS(addr) (gdbarch_smash_text_address (current_gdbarch, addr))
+#endif
+#endif
+
/* FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
the target needs software single step. An ISA method to implement it.
#!/bin/sh -u
# Architecture commands for GDB, the GNU debugger.
-# Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+# Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
#
# This file is part of GDB.
#
# sort of generic thing to handle alignment or segmentation (it's
# possible it should be in TARGET_READ_PC instead).
f:2:ADDR_BITS_REMOVE:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_identity::0
+# It is not at all clear why SMASH_TEXT_ADDRESS is not folded into
+# ADDR_BITS_REMOVE.
+f:2:SMASH_TEXT_ADDRESS:CORE_ADDR:smash_text_address:CORE_ADDR addr:addr:::core_addr_identity::0
# FIXME/cagney/2001-01-18: This should be split in two. A target method that indicates if
# the target needs software single step. An ISA method to implement it.
#
/* *INDENT-OFF* */ /* THIS FILE IS GENERATED */
/* Dynamic architecture support for GDB, the GNU debugger.
- Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GDB.
/* Read HP PA/Risc object files for GDB.
- Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+ Copyright 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
Written by Fred Fish at Cygnus Support.
symname = bufp->name.n_strx + stringtab;
ms_type = mst_text;
bufp->symbol_value += text_offset;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (bufp->symbol_value);
-#endif
+ bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
break;
case ST_ENTRY:
else
ms_type = mst_text;
bufp->symbol_value += text_offset;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (bufp->symbol_value);
-#endif
+ bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
break;
case ST_STUB:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_solib_trampoline;
bufp->symbol_value += text_offset;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (bufp->symbol_value);
-#endif
+ bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
break;
case ST_DATA:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
bufp->symbol_value += text_offset;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (bufp->symbol_value);
-#endif
+ bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
check_strange_names:
/* Utah GCC 2.5, FSF GCC 2.6 and later generate correct local
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
bufp->symbol_value += text_offset;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (bufp->symbol_value);
-#endif
+ bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
break;
case ST_ENTRY:
else
ms_type = mst_file_text;
bufp->symbol_value += text_offset;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (bufp->symbol_value);
-#endif
+ bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
break;
case ST_STUB:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_solib_trampoline;
bufp->symbol_value += text_offset;
-#ifdef SMASH_TEXT_ADDRESS
- SMASH_TEXT_ADDRESS (bufp->symbol_value);
-#endif
+ bufp->symbol_value = SMASH_TEXT_ADDRESS (bufp->symbol_value);
break;