* gdbarch.sh (DEPRECATED_FUNCTION_START_OFFSET): Deprecated.
* gdbarch.h, gdbarch.c: Re-generate.
* ada-lang.c (ada_finish_decode_line_1): Update.
* infrun.c (handle_inferior_event): Update.
* infcall.c (find_function_addr): Update.
* linespec.c (minsym_found): Update.
* symtab.c (find_function_start_sal, skip_prologue_using_sal):
Update.
* blockframe.c (legacy_frameless_look_for_prologue): Update.
* cli/cli-cmds.c (disassemble_command): Update.
* vax-tdep.c (vax_gdbarch_init): Update.
Index: doc/ChangeLog
2004-06-18 Andrew Cagney <cagney@gnu.org>
* gdbint.texinfo (Target Architecture Definition): Deprecate
FUNCTION_START_OFFSET.
+2004-06-18 Andrew Cagney <cagney@gnu.org>
+
+ * gdbarch.sh (DEPRECATED_FUNCTION_START_OFFSET): Deprecated.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * ada-lang.c (ada_finish_decode_line_1): Update.
+ * infrun.c (handle_inferior_event): Update.
+ * infcall.c (find_function_addr): Update.
+ * linespec.c (minsym_found): Update.
+ * symtab.c (find_function_start_sal, skip_prologue_using_sal):
+ Update.
+ * blockframe.c (legacy_frameless_look_for_prologue): Update.
+ * cli/cli-cmds.c (disassemble_command): Update.
+ * vax-tdep.c (vax_gdbarch_init): Update.
+
2004-06-18 Mark Kettenis <kettenis@gnu.org>
* i386-tdep.c (i386_collect_fpregset): Fix comment.
val.section = SYMBOL_BFD_SECTION (msymbol);
if (funfirstline)
{
- val.pc += FUNCTION_START_OFFSET;
+ val.pc += DEPRECATED_FUNCTION_START_OFFSET;
SKIP_PROLOGUE (val.pc);
}
selected.sals = (struct symtab_and_line *)
stmdb sp!, {}
sub sp, ip, #4. */
- func_start = (get_frame_func (fi) + FUNCTION_START_OFFSET);
+ func_start = (get_frame_func (fi) + DEPRECATED_FUNCTION_START_OFFSET);
after_prologue = SKIP_PROLOGUE (func_start);
/* There are some frameless functions whose first two instructions
func_start = get_frame_func (frame);
if (func_start)
{
- func_start += FUNCTION_START_OFFSET;
+ func_start += DEPRECATED_FUNCTION_START_OFFSET;
/* NOTE: cagney/2004-02-09: Eliminated per-architecture
PROLOGUE_FRAMELESS_P call as architectures with custom
implementations had all been deleted. Eventually even this
/* FIXME: cagney/2004-02-07: This should be an observer. */
low = tui_get_low_disassembly_address (low, pc);
#endif
- low += FUNCTION_START_OFFSET;
+ low += DEPRECATED_FUNCTION_START_OFFSET;
}
else if (!(space_index = (char *) strchr (arg, ' ')))
{
/* FIXME: cagney/2004-02-07: This should be an observer. */
low = tui_get_low_disassembly_address (low, pc);
#endif
- low += FUNCTION_START_OFFSET;
+ low += DEPRECATED_FUNCTION_START_OFFSET;
}
else
{
+2004-06-18 Andrew Cagney <cagney@gnu.org>
+
+ * gdbint.texinfo (Target Architecture Definition): Deprecate
+ FUNCTION_START_OFFSET.
+
2004-06-14 Andrew Cagney <cagney@gnu.org>
Based on changes from Karl Berry.
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.209 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.210 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
@code{FUNCTION_EPILOGUE_SIZE} to expand into the standard size of a
function's epilogue.
-@item FUNCTION_START_OFFSET
-@findex FUNCTION_START_OFFSET
+@item DEPRECATED_FUNCTION_START_OFFSET
+@findex DEPRECATED_FUNCTION_START_OFFSET
An integer, giving the offset in bytes from a function's address (as
used in the values of symbols, function pointers, etc.), and the
function's first genuine instruction.
This is zero on almost all machines: the function's address is usually
-the address of its first instruction. However, on the VAX, for example,
-each function starts with two bytes containing a bitmask indicating
-which registers to save upon entry to the function. The VAX @code{call}
-instructions check this value, and save the appropriate registers
-automatically. Thus, since the offset from the function's address to
-its first instruction is two bytes, @code{FUNCTION_START_OFFSET} would
-be 2 on the VAX.
+the address of its first instruction. However, on the VAX, for
+example, each function starts with two bytes containing a bitmask
+indicating which registers to save upon entry to the function. The
+VAX @code{call} instructions check this value, and save the
+appropriate registers automatically. Thus, since the offset from the
+function's address to its first instruction is two bytes,
+@code{DEPRECATED_FUNCTION_START_OFFSET} would be 2 on the VAX.
@item GCC_COMPILED_FLAG_SYMBOL
@itemx GCC2_COMPILED_FLAG_SYMBOL
gdbarch_memory_insert_breakpoint_ftype *memory_insert_breakpoint;
gdbarch_memory_remove_breakpoint_ftype *memory_remove_breakpoint;
CORE_ADDR decr_pc_after_break;
- CORE_ADDR function_start_offset;
+ CORE_ADDR deprecated_function_start_offset;
gdbarch_remote_translate_xfer_address_ftype *remote_translate_xfer_address;
CORE_ADDR frame_args_skip;
gdbarch_deprecated_frameless_function_invocation_ftype *deprecated_frameless_function_invocation;
0, /* memory_insert_breakpoint */
0, /* memory_remove_breakpoint */
0, /* decr_pc_after_break */
- 0, /* function_start_offset */
+ 0, /* deprecated_function_start_offset */
generic_remote_translate_xfer_address, /* remote_translate_xfer_address */
0, /* frame_args_skip */
0, /* deprecated_frameless_function_invocation */
/* Skip verify of memory_insert_breakpoint, invalid_p == 0 */
/* Skip verify of memory_remove_breakpoint, invalid_p == 0 */
/* Skip verify of decr_pc_after_break, invalid_p == 0 */
- /* Skip verify of function_start_offset, invalid_p == 0 */
+ /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
/* Skip verify of remote_translate_xfer_address, invalid_p == 0 */
/* Skip verify of frame_args_skip, invalid_p == 0 */
/* Skip verify of deprecated_frameless_function_invocation, has predicate */
(long) current_gdbarch->deprecated_frame_saved_pc
/*DEPRECATED_FRAME_SAVED_PC ()*/);
#endif
+#ifdef DEPRECATED_FUNCTION_START_OFFSET
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET # %s\n",
+ XSTRING (DEPRECATED_FUNCTION_START_OFFSET));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DEPRECATED_FUNCTION_START_OFFSET = %ld\n",
+ (long) DEPRECATED_FUNCTION_START_OFFSET);
+#endif
#ifdef DEPRECATED_GET_SAVED_REGISTER_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"gdbarch_dump: FRAME_RED_ZONE_SIZE = %d\n",
FRAME_RED_ZONE_SIZE);
#endif
-#ifdef FUNCTION_START_OFFSET
- fprintf_unfiltered (file,
- "gdbarch_dump: FUNCTION_START_OFFSET # %s\n",
- XSTRING (FUNCTION_START_OFFSET));
- fprintf_unfiltered (file,
- "gdbarch_dump: FUNCTION_START_OFFSET = %ld\n",
- (long) FUNCTION_START_OFFSET);
-#endif
#ifdef GET_LONGJMP_TARGET_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
}
CORE_ADDR
-gdbarch_function_start_offset (struct gdbarch *gdbarch)
+gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
- /* Skip verify of function_start_offset, invalid_p == 0 */
+ /* Skip verify of deprecated_function_start_offset, invalid_p == 0 */
if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n");
- return gdbarch->function_start_offset;
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_function_start_offset called\n");
+ return gdbarch->deprecated_function_start_offset;
}
void
-set_gdbarch_function_start_offset (struct gdbarch *gdbarch,
- CORE_ADDR function_start_offset)
+set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch,
+ CORE_ADDR deprecated_function_start_offset)
{
- gdbarch->function_start_offset = function_start_offset;
+ gdbarch->deprecated_function_start_offset = deprecated_function_start_offset;
}
void
#define DECR_PC_AFTER_BREAK (gdbarch_decr_pc_after_break (current_gdbarch))
#endif
-extern CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch);
-extern void set_gdbarch_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR function_start_offset);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (FUNCTION_START_OFFSET)
-#error "Non multi-arch definition of FUNCTION_START_OFFSET"
-#endif
-#if !defined (FUNCTION_START_OFFSET)
-#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
+/* A function can be addressed by either it's "pointer" (possibly a
+ descriptor address) or "entry point" (first executable instruction).
+ The method "convert_from_func_ptr_addr" converting the former to the
+ latter. DEPRECATED_FUNCTION_START_OFFSET is being used to implement
+ a simplified subset of that functionality - the function's address
+ corresponds to the "function pointer" and the function's start
+ corresponds to the "function entry point" - and hence is redundant. */
+
+extern CORE_ADDR gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch);
+extern void set_gdbarch_deprecated_function_start_offset (struct gdbarch *gdbarch, CORE_ADDR deprecated_function_start_offset);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_FUNCTION_START_OFFSET)
+#error "Non multi-arch definition of DEPRECATED_FUNCTION_START_OFFSET"
+#endif
+#if !defined (DEPRECATED_FUNCTION_START_OFFSET)
+#define DEPRECATED_FUNCTION_START_OFFSET (gdbarch_deprecated_function_start_offset (current_gdbarch))
#endif
typedef void (gdbarch_remote_translate_xfer_address_ftype) (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len);
f:MEMORY_INSERT_BREAKPOINT:int:memory_insert_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_insert_breakpoint::0
f:MEMORY_REMOVE_BREAKPOINT:int:memory_remove_breakpoint:CORE_ADDR addr, char *contents_cache:addr, contents_cache::0:default_memory_remove_breakpoint::0
v:DECR_PC_AFTER_BREAK:CORE_ADDR:decr_pc_after_break::::0:::0
-v:FUNCTION_START_OFFSET:CORE_ADDR:function_start_offset::::0:::0
-#
+
+# A function can be addressed by either it's "pointer" (possibly a
+# descriptor address) or "entry point" (first executable instruction).
+# The method "convert_from_func_ptr_addr" converting the former to the
+# latter. DEPRECATED_FUNCTION_START_OFFSET is being used to implement
+# a simplified subset of that functionality - the function's address
+# corresponds to the "function pointer" and the function's start
+# corresponds to the "function entry point" - and hence is redundant.
+
+v:DEPRECATED_FUNCTION_START_OFFSET:CORE_ADDR:deprecated_function_start_offset::::0:::0
+
m:REMOTE_TRANSLATE_XFER_ADDRESS:void:remote_translate_xfer_address:struct regcache *regcache, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len:regcache, gdb_addr, gdb_len, rem_addr, rem_len:::generic_remote_translate_xfer_address::0
#
v:FRAME_ARGS_SKIP:CORE_ADDR:frame_args_skip::::0:::0
if (retval_type != NULL)
*retval_type = value_type;
- return funaddr + FUNCTION_START_OFFSET;
+ return funaddr + DEPRECATED_FUNCTION_START_OFFSET;
}
/* Call breakpoint_auto_delete on the current contents of the bpstat
will both be 0 if it doesn't work. */
find_pc_partial_function (stop_pc, &ecs->stop_func_name,
&ecs->stop_func_start, &ecs->stop_func_end);
- ecs->stop_func_start += FUNCTION_START_OFFSET;
+ ecs->stop_func_start += DEPRECATED_FUNCTION_START_OFFSET;
ecs->another_trap = 0;
bpstat_clear (&stop_bpstat);
stop_step = 0;
values.sals[0].section = SYMBOL_BFD_SECTION (msymbol);
if (funfirstline)
{
- values.sals[0].pc += FUNCTION_START_OFFSET;
+ values.sals[0].pc += DEPRECATED_FUNCTION_START_OFFSET;
values.sals[0].pc = SKIP_PROLOGUE (values.sals[0].pc);
}
values.nelts = 1;
!section_is_mapped (section))
pc = overlay_unmapped_address (pc, section);
- pc += FUNCTION_START_OFFSET;
+ pc += DEPRECATED_FUNCTION_START_OFFSET;
pc = SKIP_PROLOGUE (pc);
/* For overlays, map pc back into its mapped VMA range */
/* Get an initial range for the function. */
find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc);
- start_pc += FUNCTION_START_OFFSET;
+ start_pc += DEPRECATED_FUNCTION_START_OFFSET;
prologue_sal = find_pc_line (start_pc, 0);
if (prologue_sal.line != 0)
set_gdbarch_breakpoint_from_pc (gdbarch, vax_breakpoint_from_pc);
/* Misc info */
- set_gdbarch_function_start_offset (gdbarch, 2);
+ set_gdbarch_deprecated_function_start_offset (gdbarch, 2);
set_gdbarch_believe_pcc_promotion (gdbarch, 1);
set_gdbarch_print_insn (gdbarch, print_insn_vax);