/* Print and select stack frames for GDB, the GNU debugger.
- Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996,
- 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB.
annotate_frame_source_end ();
}
-#ifdef PC_LOAD_SEGMENT
- /* If we couldn't print out function name but if can figure out what
- load segment this pc value is from, at least print out some info
- about its load segment. */
- if (!funname)
- {
- annotate_frame_where ();
-#ifdef UI_OUT
- ui_out_wrap_hint (uiout, " ");
- ui_out_text (uiout, " from ");
- ui_out_field_string (uiout, "from", PC_LOAD_SEGMENT (fi->pc));
-#else
- wrap_here (" ");
- printf_filtered (" from %s", PC_LOAD_SEGMENT (fi->pc));
-#endif
- }
-#endif /* PC_LOAD_SEGMENT */
-
#ifdef PC_SOLIB
if (!funname || (!sal.symtab || !sal.symtab->filename))
{
int numargs = 0;
#define MAXARGS 4
CORE_ADDR args[MAXARGS];
+ int level;
if (frame_exp)
{
addr_string = savestring (frame_exp, p - frame_exp);
{
+ value_ptr vp;
+
tmp_cleanup = make_cleanup (xfree, addr_string);
- args[numargs++] = parse_and_eval_address (addr_string);
+
+ /* NOTE: we call parse_and_eval and then both
+ value_as_long and value_as_pointer rather than calling
+ parse_and_eval_long and parse_and_eval_address because
+ of the issue of potential side effects from evaluating
+ the expression. */
+ vp = parse_and_eval (addr_string);
+ if (numargs == 0)
+ level = value_as_long (vp);
+
+ args[numargs++] = value_as_pointer (vp);
do_cleanups (tmp_cleanup);
}
/* NOTREACHED */
case 1:
{
- int level = args[0];
struct frame_info *fid =
find_relative_frame (get_current_frame (), &level);
struct frame_info *tfid;
print_address_numeric (fi->saved_regs[SP_REGNUM], 1, gdb_stdout);
printf_filtered ("\n");
count = 0;
- numregs = ARCH_NUM_REGS;
+ numregs = NUM_REGS;
for (i = 0; i < numregs; i++)
if (fi->saved_regs[i] && i != SP_REGNUM)
{