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. Index: doc/ChangeLog 2004-06-18 Andrew Cagney <cagney@gnu.org> * gdbint.texinfo (Target Architecture Definition): Deprecate FUNCTION_START_OFFSET.
This commit is contained in:
parent
b2d38a17cf
commit
782263ab3a
@ -1,3 +1,17 @@
|
||||
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.
|
||||
|
@ -5596,7 +5596,7 @@ ada_finish_decode_line_1 (char **spec, struct symtab *file_table,
|
||||
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 *)
|
||||
|
@ -291,7 +291,7 @@ arm_frameless_function_invocation (struct frame_info *fi)
|
||||
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
|
||||
|
@ -147,7 +147,7 @@ legacy_frameless_look_for_prologue (struct frame_info *frame)
|
||||
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
|
||||
|
@ -858,7 +858,7 @@ disassemble_command (char *arg, int from_tty)
|
||||
/* 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, ' ')))
|
||||
{
|
||||
@ -873,7 +873,7 @@ disassemble_command (char *arg, int from_tty)
|
||||
/* 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
|
||||
{
|
||||
|
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
@ -3260,20 +3260,20 @@ function end symbol is 0. For such targets, you must define
|
||||
@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
|
||||
|
@ -197,7 +197,7 @@ struct gdbarch
|
||||
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;
|
||||
@ -343,7 +343,7 @@ struct gdbarch startup_gdbarch =
|
||||
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 */
|
||||
@ -621,7 +621,7 @@ verify_gdbarch (struct gdbarch *current_gdbarch)
|
||||
/* 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 */
|
||||
@ -1084,6 +1084,14 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
|
||||
(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",
|
||||
@ -1526,14 +1534,6 @@ gdbarch_dump (struct gdbarch *current_gdbarch, struct ui_file *file)
|
||||
"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",
|
||||
@ -3760,20 +3760,20 @@ set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch,
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -1312,13 +1312,21 @@ extern void set_gdbarch_decr_pc_after_break (struct gdbarch *gdbarch, CORE_ADDR
|
||||
#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"
|
||||
/* 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 (FUNCTION_START_OFFSET)
|
||||
#define FUNCTION_START_OFFSET (gdbarch_function_start_offset (current_gdbarch))
|
||||
#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);
|
||||
|
@ -583,8 +583,17 @@ M:ADJUST_BREAKPOINT_ADDRESS:CORE_ADDR:adjust_breakpoint_address:CORE_ADDR bpaddr
|
||||
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
|
||||
|
@ -207,7 +207,7 @@ find_function_addr (struct value *function, struct type **retval_type)
|
||||
|
||||
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
|
||||
|
@ -1817,7 +1817,7 @@ handle_inferior_event (struct execution_control_state *ecs)
|
||||
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;
|
||||
|
@ -1842,7 +1842,7 @@ minsym_found (int funfirstline, struct minimal_symbol *msymbol)
|
||||
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;
|
||||
|
@ -2413,7 +2413,7 @@ find_function_start_sal (struct symbol *sym, int funfirstline)
|
||||
!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 */
|
||||
@ -3985,7 +3985,7 @@ skip_prologue_using_sal (CORE_ADDR func_addr)
|
||||
|
||||
/* 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)
|
||||
|
@ -506,7 +506,7 @@ vax_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user