return 1;
if (symfile_objfile == 0)
return 0;
+#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+ /* Do not stop backtracing if the pc is in the call dummy
+ at the entry point. */
+ if (PC_IN_CALL_DUMMY (addr, 0, 0))
+ return 0;
+#endif
return (addr >= symfile_objfile -> ei.entry_file_lowpc &&
addr < symfile_objfile -> ei.entry_file_highpc);
}
return 1;
if (symfile_objfile == 0)
return 0;
+#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+ /* Do not stop backtracing if the pc is in the call dummy
+ at the entry point. */
+ if (PC_IN_CALL_DUMMY (pc, 0, 0))
+ return 0;
+#endif
return (symfile_objfile -> ei.entry_func_lowpc <= pc &&
symfile_objfile -> ei.entry_func_highpc > pc);
}
void
reinit_frame_cache ()
{
- FRAME fr = current_frame;
flush_cached_frames ();
- if (fr)
- set_current_frame ( create_new_frame (read_fp (), read_pc ()));
+ if (target_has_stack)
+ {
+ set_current_frame (create_new_frame (read_fp (), read_pc ()));
+ select_frame (get_current_frame (), 0);
+ }
+ else
+ {
+ set_current_frame (0);
+ select_frame ((FRAME) 0, -1);
+ }
}
/* Return a structure containing various interesting information
get_prev_frame_info (next_frame)
FRAME next_frame;
{
- FRAME_ADDR address;
+ FRAME_ADDR address = 0;
struct frame_info *prev;
int fromleaf = 0;
char *name;
fi = get_frame_info (frame);
pc = fi->pc;
- if (fi->next != 0)
- /* We are not in the innermost frame. We need to subtract one to
- get the correct block, in case the call instruction was the
- last instruction of the block. If there are any machines on
- which the saved pc does not point to after the call insn, we
- probably want to make fi->pc point after the call insn anyway. */
+ if (fi->next != 0 && fi->next->signal_handler_caller == 0)
+ /* We are not in the innermost frame and we were not interrupted
+ by a signal. We need to subtract one to get the correct block,
+ in case the call instruction was the last instruction of the block.
+ If there are any machines on which the saved pc does not point to
+ after the call insn, we probably want to make fi->pc point after
+ the call insn anyway. */
--pc;
return block_for_pc (pc);
}
struct symbol *f;
struct minimal_symbol *msymbol;
struct partial_symbol *psb;
+ struct obj_section *sec;
if (pc >= cache_pc_function_low && pc < cache_pc_function_high)
goto return_cached_value;
{
/* Need to read the symbols to get a good value for the end address. */
if (endaddr != NULL && !pst->readin)
- PSYMTAB_TO_SYMTAB (pst);
+ {
+ /* Need to get the terminal in case symbol-reading produces
+ output. */
+ target_terminal_ours_for_output ();
+ PSYMTAB_TO_SYMTAB (pst);
+ }
if (pst->readin)
{
goto return_cached_value;
}
}
-
- /* Now that static symbols go in the minimal symbol table, perhaps
- we could just ignore the partial symbols. But at least for now
- we use the partial or minimal symbol, whichever is larger. */
- psb = find_pc_psymbol (pst, pc);
-
- if (psb
- && (msymbol == NULL ||
- (SYMBOL_VALUE_ADDRESS (psb) >= SYMBOL_VALUE_ADDRESS (msymbol))))
+ else
{
- /* This case isn't being cached currently. */
- if (address)
- *address = SYMBOL_VALUE_ADDRESS (psb);
- if (name)
- *name = SYMBOL_NAME (psb);
- /* endaddr non-NULL can't happen here. */
- return 1;
+ /* Now that static symbols go in the minimal symbol table, perhaps
+ we could just ignore the partial symbols. But at least for now
+ we use the partial or minimal symbol, whichever is larger. */
+ psb = find_pc_psymbol (pst, pc);
+
+ if (psb
+ && (msymbol == NULL ||
+ (SYMBOL_VALUE_ADDRESS (psb)
+ >= SYMBOL_VALUE_ADDRESS (msymbol))))
+ {
+ /* This case isn't being cached currently. */
+ if (address)
+ *address = SYMBOL_VALUE_ADDRESS (psb);
+ if (name)
+ *name = SYMBOL_NAME (psb);
+ /* endaddr non-NULL can't happen here. */
+ return 1;
+ }
}
}
+ /* Not in the normal symbol tables, see if the pc is in a known section.
+ If it's not, then give up. This ensures that anything beyond the end
+ of the text seg doesn't appear to be part of the last function in the
+ text segment. */
+
+ sec = find_pc_section (pc);
+
+ if (!sec)
+ msymbol = NULL;
+
/* Must be in the minimal symbol table. */
if (msymbol == NULL)
{
return 0;
}
- /* I believe the purpose of this check is to make sure that anything
- beyond the end of the text segment does not appear as part of the
- last function of the text segment. It assumes that there is something
- other than a mst_text symbol after the text segment. It is broken in
- various cases, so anything relying on this behavior (there might be
- some places) should be using find_pc_section or some such instead. */
+ /* See if we're in a transfer table for Sun shared libs. */
+
if (msymbol -> type == mst_text)
cache_pc_function_low = SYMBOL_VALUE_ADDRESS (msymbol);
else
/* It is a transfer table for Sun shared libraries. */
cache_pc_function_low = pc - FUNCTION_START_OFFSET;
+
cache_pc_function_name = SYMBOL_NAME (msymbol);
- if (SYMBOL_NAME (msymbol + 1) != NULL)
- /* This might be part of a different segment, which might be a bad
- idea. Perhaps we should be using the smaller of this address or the
- endaddr from find_pc_section. */
+ /* Use the lesser of the next minimal symbol, or the end of the section, as
+ the end of the function. */
+
+ if (SYMBOL_NAME (msymbol + 1) != NULL
+ && SYMBOL_VALUE_ADDRESS (msymbol + 1) < sec->endaddr)
cache_pc_function_high = SYMBOL_VALUE_ADDRESS (msymbol + 1);
else
- {
- /* We got the start address from the last msymbol in the objfile.
- So the end address is the end of the section. */
- struct obj_section *sec;
-
- sec = find_pc_section (pc);
- if (sec == NULL)
- {
- /* Don't know if this can happen but if it does, then just say
- that the function is 1 byte long. */
- cache_pc_function_high = cache_pc_function_low + 1;
- }
- else
- cache_pc_function_high = sec->endaddr;
- }
+ /* We got the start address from the last msymbol in the objfile.
+ So the end address is the end of the section. */
+ cache_pc_function_high = sec->endaddr;
return_cached_value:
if (address)
}
/* Return the innermost stack frame executing inside of BLOCK,
- or zero if there is no such frame. If BLOCK is NULL, just return NULL. */
+ or NULL if there is no such frame. If BLOCK is NULL, just return NULL. */
FRAME
block_innermost_frame (block)
{
struct frame_info *fi;
register FRAME frame;
- register CORE_ADDR start = BLOCK_START (block);
- register CORE_ADDR end = BLOCK_END (block);
+ register CORE_ADDR start;
+ register CORE_ADDR end;
if (block == NULL)
return NULL;
+ start = BLOCK_START (block);
+ end = BLOCK_END (block);
+
frame = 0;
while (1)
{