* f-valprint.c (info_common_command): Use get_frame_pc.
* std-regs.c (value_of_builtin_frame_pc_reg): Ditto.
* ax-gdb.c (agent_command): Ditto.
* rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto.
(rs6000_pop_frame): Ditto.
(rs6000_frameless_function_invocation): Ditto.
(rs6000_frame_saved_pc, frame_get_saved_regs): Ditto.
(frame_initial_stack_address, rs6000_frame_chain): Ditto.
* macroscope.c (default_macro_scope): Ditto.
* stack.c (print_frame_info_base): Ditto.
(print_frame, frame_info, print_frame_label_vars): Ditto.
(return_command, func_command, get_frame_language): Ditto.
* infcmd.c (finish_command): Ditto.
* dummy-frame.c (cached_find_dummy_frame): Ditto.
* breakpoint.c (deprecated_frame_in_dummy): Ditto.
(break_at_finish_at_depth_command_1): Ditto.
(break_at_finish_command_1): Ditto.
(until_break_command, get_catch_sals): Ditto.
* blockframe.c (func_frame_chain_valid): Ditto.
(frameless_look_for_prologue): Ditto.
(frame_address_in_block, generic_func_frame_chain_valid): Ditto.
+2002-12-07 Andrew Cagney <ac131313@redhat.com>
+
+ * f-valprint.c (info_common_command): Use get_frame_pc.
+ * std-regs.c (value_of_builtin_frame_pc_reg): Ditto.
+ * ax-gdb.c (agent_command): Ditto.
+ * rs6000-tdep.c (rs6000_init_extra_frame_info): Ditto.
+ (rs6000_pop_frame): Ditto.
+ (rs6000_frameless_function_invocation): Ditto.
+ (rs6000_frame_saved_pc, frame_get_saved_regs): Ditto.
+ (frame_initial_stack_address, rs6000_frame_chain): Ditto.
+ * macroscope.c (default_macro_scope): Ditto.
+ * stack.c (print_frame_info_base): Ditto.
+ (print_frame, frame_info, print_frame_label_vars): Ditto.
+ (return_command, func_command, get_frame_language): Ditto.
+ * infcmd.c (finish_command): Ditto.
+ * dummy-frame.c (cached_find_dummy_frame): Ditto.
+ * breakpoint.c (deprecated_frame_in_dummy): Ditto.
+ (break_at_finish_at_depth_command_1): Ditto.
+ (break_at_finish_command_1): Ditto.
+ (until_break_command, get_catch_sals): Ditto.
+ * blockframe.c (func_frame_chain_valid): Ditto.
+ (frameless_look_for_prologue): Ditto.
+ (frame_address_in_block, generic_func_frame_chain_valid): Ditto.
+
2002-12-08 Andrew Cagney <ac131313@redhat.com>
* config/rs6000/tm-rs6000.h (init_frame_pc_noop): Add declaration.
expr = parse_expression (exp);
old_chain = make_cleanup (free_current_contents, &expr);
- agent = gen_trace_for_expr (fi->pc, expr);
+ agent = gen_trace_for_expr (get_frame_pc (fi), expr);
make_cleanup_free_agent_expr (agent);
ax_print (gdb_stdout, agent);
func_frame_chain_valid (CORE_ADDR chain, struct frame_info *thisframe)
{
return ((chain) != 0
- && !inside_main_func ((thisframe)->pc)
- && !inside_entry_func ((thisframe)->pc));
+ && !inside_main_func (get_frame_pc (thisframe))
+ && !inside_entry_func (get_frame_pc (thisframe)));
}
/* A very simple method of determining a valid frame */
{
CORE_ADDR func_start, after_prologue;
- func_start = get_pc_function_start (frame->pc);
+ func_start = get_pc_function_start (get_frame_pc (frame));
if (func_start)
{
func_start += FUNCTION_START_OFFSET;
prologue, not how long it is. */
return PROLOGUE_FRAMELESS_P (func_start);
}
- else if (frame->pc == 0)
+ else if (get_frame_pc (frame) == 0)
/* A frame with a zero PC is usually created by dereferencing a
NULL function pointer, normally causing an immediate core dump
of the inferior. Mark function as frameless, as the inferior
CORE_ADDR
frame_address_in_block (struct frame_info *frame)
{
- CORE_ADDR pc = frame->pc;
+ CORE_ADDR pc = get_frame_pc (frame);
/* If we are not in the innermost frame, and we are not interrupted
by a signal, frame->pc points to the instruction following the
generic_func_frame_chain_valid (CORE_ADDR fp, struct frame_info *fi)
{
if (DEPRECATED_USE_GENERIC_DUMMY_FRAMES
- && DEPRECATED_PC_IN_CALL_DUMMY ((fi)->pc, 0, 0))
+ && DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi), 0, 0))
return 1; /* don't prune CALL_DUMMY frames */
else /* fall back to default algorithm (see frame.h) */
return (fp != 0
&& (INNER_THAN (get_frame_base (fi), fp)
|| get_frame_base (fi) == fp)
- && !inside_main_func ((fi)->pc)
- && !inside_entry_func ((fi)->pc));
+ && !inside_main_func (get_frame_pc (fi))
+ && !inside_entry_func (get_frame_pc (fi)));
}
&& b->frame == get_frame_base (frame)
/* We need to check the PC as well as the frame on the sparc,
for signals.exp in the testsuite. */
- && (frame->pc
+ && (get_frame_pc (frame)
>= (b->address
- - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE))
- && frame->pc <= b->address)
+ - SIZEOF_CALL_DUMMY_WORDS / sizeof (LONGEST) * REGISTER_SIZE))
+ && get_frame_pc (frame) <= b->address)
return 1;
}
return 0;
{
if (deprecated_selected_frame)
{
- selected_pc = deprecated_selected_frame->pc;
+ selected_pc = get_frame_pc (deprecated_selected_frame);
if (arg)
if_arg = 1;
}
frame = parse_frame_specification (level_arg);
if (frame)
- selected_pc = frame->pc;
+ selected_pc = get_frame_pc (frame);
else
selected_pc = 0;
}
if (deprecated_selected_frame)
{
addr_string = (char *) xmalloc (15);
- sprintf (addr_string, "*0x%s", paddr_nz (deprecated_selected_frame->pc));
+ sprintf (addr_string, "*0x%s",
+ paddr_nz (get_frame_pc (deprecated_selected_frame)));
if (arg)
if_arg = 1;
}
if (prev_frame)
{
- sal = find_pc_line (prev_frame->pc, 0);
- sal.pc = prev_frame->pc;
+ sal = find_pc_line (get_frame_pc (prev_frame), 0);
+ sal.pc = get_frame_pc (prev_frame);
breakpoint = set_momentary_breakpoint (sal, prev_frame, bp_until);
if (!event_loop_p || !target_can_async_p ())
make_cleanup_delete_breakpoint (breakpoint);
if (deprecated_selected_frame == NULL)
error ("No selected frame.");
block = get_frame_block (deprecated_selected_frame, 0);
- pc = deprecated_selected_frame->pc;
+ pc = get_frame_pc (deprecated_selected_frame);
sals.nelts = 0;
sals.sals = NULL;
cached_find_dummy_frame (struct frame_info *frame, void **cache)
{
if ((*cache) == NULL)
- (*cache) = find_dummy_frame (frame->pc, get_frame_base (frame));
+ (*cache) = find_dummy_frame (get_frame_pc (frame), get_frame_base (frame));
return (*cache);
}
/* The following is generally ripped off from stack.c's routine
print_frame_info() */
- func = find_pc_function (fi->pc);
+ func = find_pc_function (get_frame_pc (fi));
if (func)
{
/* In certain pathological cases, the symtabs give the wrong
be any minimal symbols in the middle of a function.
FIXME: (Not necessarily true. What about text labels) */
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
+ struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi));
if (msymbol != NULL
&& (SYMBOL_VALUE_ADDRESS (msymbol)
else
{
register struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (fi->pc);
+ lookup_minimal_symbol_by_pc (get_frame_pc (fi));
if (msymbol != NULL)
funname = SYMBOL_NAME (msymbol);
clear_proceed_status ();
- sal = find_pc_line (frame->pc, 0);
- sal.pc = frame->pc;
+ sal = find_pc_line (get_frame_pc (frame), 0);
+ sal.pc = get_frame_pc (frame);
breakpoint = set_momentary_breakpoint (sal, frame, bp_finish);
/* Find the function we will return from. */
- function = find_pc_function (deprecated_selected_frame->pc);
+ function = find_pc_function (get_frame_pc (deprecated_selected_frame));
/* Print info on the selected frame, including level number
but not source. */
/* If there's a selected frame, use its PC. */
if (deprecated_selected_frame)
- sal = find_pc_line (deprecated_selected_frame->pc, 0);
+ sal = find_pc_line (get_frame_pc (deprecated_selected_frame), 0);
/* If the target has any registers at all, then use its PC. Why we
would have registers but no stack, I'm not sure. */
fi->extra_info = (struct frame_extra_info *)
frame_obstack_alloc (sizeof (struct frame_extra_info));
fi->extra_info->initial_sp = 0;
- if (get_next_frame (fi) != (CORE_ADDR) 0
- && fi->pc < TEXT_SEGMENT_BASE)
+ if (get_next_frame (fi) != NULL
+ && get_frame_pc (fi) < TEXT_SEGMENT_BASE)
/* We're in get_prev_frame */
/* and this is a special signal frame. */
/* (fi->pc will be some low address in the kernel, */
pc = read_pc ();
sp = get_frame_base (frame);
- if (DEPRECATED_PC_IN_CALL_DUMMY (frame->pc,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (frame),
get_frame_base (frame),
get_frame_base (frame)))
{
still in the link register, otherwise walk the frames and retrieve the
saved %pc value in the previous frame. */
- addr = get_pc_function_start (frame->pc);
- (void) skip_prologue (addr, frame->pc, &fdata);
+ addr = get_pc_function_start (get_frame_pc (frame));
+ (void) skip_prologue (addr, get_frame_pc (frame), &fdata);
wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
if (fdata.frameless)
&& !(get_frame_type (get_next_frame (fi)) == SIGTRAMP_FRAME))
return 0;
- func_start = get_pc_function_start (fi->pc);
+ func_start = get_pc_function_start (get_frame_pc (fi));
/* If we failed to find the start of the function, it is a mistake
to inspect the instructions. */
function pointer, normally causing an immediate core dump of the
inferior. Mark function as frameless, as the inferior has no chance
of setting up a stack frame. */
- if (fi->pc == 0)
+ if (get_frame_pc (fi) == 0)
return 1;
else
return 0;
}
- (void) skip_prologue (func_start, fi->pc, &fdata);
+ (void) skip_prologue (func_start, get_frame_pc (fi), &fdata);
return fdata.frameless;
}
return read_memory_addr (get_frame_base (fi) + SIG_FRAME_PC_OFFSET,
wordsize);
- if (DEPRECATED_PC_IN_CALL_DUMMY (fi->pc,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (fi),
get_frame_base (fi),
get_frame_base (fi)))
- return deprecated_read_register_dummy (fi->pc,
+ return deprecated_read_register_dummy (get_frame_pc (fi),
get_frame_base (fi), PC_REGNUM);
- func_start = get_pc_function_start (fi->pc);
+ func_start = get_pc_function_start (get_frame_pc (fi));
/* If we failed to find the start of the function, it is a mistake
to inspect the instructions. */
if (!func_start)
return 0;
- (void) skip_prologue (func_start, fi->pc, &fdata);
+ (void) skip_prologue (func_start, get_frame_pc (fi), &fdata);
if (fdata.lr_offset == 0 && get_next_frame (fi) != NULL)
{
return read_memory_addr ((get_frame_base (get_next_frame (fi))
+ SIG_FRAME_LR_OFFSET),
wordsize);
- else if (DEPRECATED_PC_IN_CALL_DUMMY (get_next_frame (fi)->pc, 0, 0))
+ else if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (get_next_frame (fi)), 0, 0))
/* The link register wasn't saved by this frame and the next
(inner, newer) frame is a dummy. Get the link register
value by unwinding it from that [dummy] frame. */
if (fdatap == NULL)
{
fdatap = &work_fdata;
- (void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, fdatap);
+ (void) skip_prologue (get_pc_function_start (get_frame_pc (fi)),
+ get_frame_pc (fi), fdatap);
}
frame_saved_regs_zalloc (fi);
/* Find out if this function is using an alloca register. */
- (void) skip_prologue (get_pc_function_start (fi->pc), fi->pc, &fdata);
+ (void) skip_prologue (get_pc_function_start (get_frame_pc (fi)),
+ get_frame_pc (fi), &fdata);
/* If saved registers of this frame are not known yet, read and
cache them. */
CORE_ADDR fp, fpp, lr;
int wordsize = gdbarch_tdep (current_gdbarch)->wordsize;
- if (DEPRECATED_PC_IN_CALL_DUMMY (thisframe->pc,
+ if (DEPRECATED_PC_IN_CALL_DUMMY (get_frame_pc (thisframe),
get_frame_base (thisframe),
get_frame_base (thisframe)))
/* A dummy frame always correctly chains back to the previous
frame. */
return read_memory_addr (get_frame_base (thisframe), wordsize);
- if (inside_entry_file (thisframe->pc) ||
- thisframe->pc == entry_point_address ())
+ if (inside_entry_file (get_frame_pc (thisframe))
+ || get_frame_pc (thisframe) == entry_point_address ())
return 0;
if ((get_frame_type (thisframe) == SIGTRAMP_FRAME))
if (get_frame_type (fi) == DUMMY_FRAME)
{
- annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
+ annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi));
/* Do this regardless of SOURCE because we don't have any source
to list for this frame. */
}
if ((get_frame_type (fi) == SIGTRAMP_FRAME))
{
- annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
+ annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi));
/* Do this regardless of SOURCE because we don't have any source
to list for this frame. */
{
struct symtab_and_line cursal;
int done = 0;
- int mid_statement = (source == SRC_LINE) && (fi->pc != sal.pc);
+ int mid_statement = (source == SRC_LINE) && (get_frame_pc (fi) != sal.pc);
if (annotation_level)
done = identify_source_line (sal.symtab, sal.line, mid_statement,
- fi->pc);
+ get_frame_pc (fi));
if (!done)
{
if (print_frame_info_listing_hook)
ability to decide for themselves if it is desired. */
if (addressprint && mid_statement)
{
- ui_out_field_core_addr (uiout, "addr", fi->pc);
+ ui_out_field_core_addr (uiout, "addr", get_frame_pc (fi));
ui_out_text (uiout, "\t");
}
}
if (source != 0)
- set_default_breakpoint (1, fi->pc, sal.symtab, sal.line);
+ set_default_breakpoint (1, get_frame_pc (fi), sal.symtab, sal.line);
annotate_frame_end ();
}
}
- annotate_frame_begin (level == -1 ? 0 : level, fi->pc);
+ annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi));
list_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "frame");
ui_out_field_fmt_int (uiout, 2, ui_left, "level", level);
}
if (addressprint)
- if (fi->pc != sal.pc || !sal.symtab || source == LOC_AND_ADDRESS)
+ if (get_frame_pc (fi) != sal.pc
+ || !sal.symtab
+ || source == LOC_AND_ADDRESS)
{
annotate_frame_address ();
- ui_out_field_core_addr (uiout, "addr", fi->pc);
+ ui_out_field_core_addr (uiout, "addr", get_frame_pc (fi));
annotate_frame_address_end ();
ui_out_text (uiout, " in ");
}
#ifdef PC_SOLIB
if (!funname || (!sal.symtab || !sal.symtab->filename))
{
- char *lib = PC_SOLIB (fi->pc);
+ char *lib = PC_SOLIB (get_frame_pc (fi));
if (lib)
{
annotate_frame_where ();
func = get_frame_function (fi);
/* FIXME: cagney/2002-11-28: Why bother? Won't sal.symtab contain
the same value. */
- s = find_pc_symtab (fi->pc);
+ s = find_pc_symtab (get_frame_pc (fi));
if (func)
{
/* I'd like to use SYMBOL_SOURCE_NAME() here, to display
}
else
{
- register struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
+ register struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (get_frame_pc (fi));
if (msymbol != NULL)
{
funname = SYMBOL_NAME (msymbol);
printf_filtered (":\n");
}
printf_filtered (" %s = ", REGISTER_NAME (PC_REGNUM));
- print_address_numeric (fi->pc, 1, gdb_stdout);
+ print_address_numeric (get_frame_pc (fi), 1, gdb_stdout);
wrap_here (" ");
if (funname)
register int values_printed = 0;
int index, have_default = 0;
char *blocks_printed;
- CORE_ADDR pc = fi->pc;
+ CORE_ADDR pc = get_frame_pc (fi);
if (block == 0)
{
error ("No selected frame.");
thisfun = get_frame_function (deprecated_selected_frame);
selected_frame_addr = get_frame_base (deprecated_selected_frame);
- selected_frame_pc = deprecated_selected_frame->pc;
+ selected_frame_pc = get_frame_pc (deprecated_selected_frame);
/* Compute the return value (if any -- possibly getting errors here). */
selected frame shares its fp with another frame. */
while (selected_frame_addr != get_frame_base (frame = get_current_frame ())
- || selected_frame_pc != frame->pc)
+ || selected_frame_pc != get_frame_pc (frame))
POP_FRAME;
/* Then pop that frame. */
do
{
for (i = 0; (i < sals.nelts && !found); i++)
- found = (fp->pc >= func_bounds[i].low &&
- fp->pc < func_bounds[i].high);
+ found = (get_frame_pc (fp) >= func_bounds[i].low &&
+ get_frame_pc (fp) < func_bounds[i].high);
if (!found)
{
level = 1;
if (deprecated_selected_frame)
{
- s = find_pc_symtab (deprecated_selected_frame->pc);
+ s = find_pc_symtab (get_frame_pc (deprecated_selected_frame));
if (s)
flang = s->language;
else
if (frame == NULL)
memset (buf, TYPE_LENGTH (VALUE_TYPE (val)), 0);
else
- ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf, frame->pc);
+ ADDRESS_TO_POINTER (builtin_type_void_data_ptr, buf,
+ get_frame_pc (frame));
return val;
}
}
{
if (args == 0 || *args == 0)
{
- sal = find_pc_line ((get_current_frame ())->pc, 0);
+ sal = find_pc_line (get_frame_pc (get_current_frame ()), 0);
sals.nelts = 1;
sals.sals = (struct symtab_and_line *)
xmalloc (sizeof (struct symtab_and_line));