Move 'is_regular_file' from common-utils.c to filestuff.c
[deliverable/binutils-gdb.git] / gdb / frame.h
index c75100274b7673b783dae0b8cccfce482554c376..2793204e568330abc23137d0514dd5f8e11c496e 100644 (file)
@@ -1,6 +1,6 @@
 /* Definitions for dealing with stack frames, for GDB, the GNU debugger.
 
-   Copyright (C) 1986-2017 Free Software Foundation, Inc.
+   Copyright (C) 1986-2018 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -26,7 +26,7 @@
 
    Prefixes:
 
-   get_frame_WHAT...(): Get WHAT from the THIS frame (functionaly
+   get_frame_WHAT...(): Get WHAT from the THIS frame (functionally
    equivalent to THIS->next->unwind->what)
 
    frame_unwind_WHAT...(): Unwind THIS frame's WHAT from the NEXT
@@ -164,6 +164,25 @@ struct frame_id
   int artificial_depth;
 };
 
+/* Save and restore the currently selected frame.  */
+
+class scoped_restore_selected_frame
+{
+public:
+  /* Save the currently selected frame.  */
+  scoped_restore_selected_frame ();
+
+  /* Restore the currently selected frame.  */
+  ~scoped_restore_selected_frame ();
+
+  DISABLE_COPY_AND_ASSIGN (scoped_restore_selected_frame);
+
+private:
+
+  /* The ID of the previously selected frame.  */
+  struct frame_id m_fid;
+};
+
 /* Methods for constructing and comparing Frame IDs.  */
 
 /* For convenience.  All fields are zero.  This means "there is no frame".  */
@@ -540,7 +559,7 @@ const char *frame_stop_reason_string (struct frame_info *);
    (up, older) frame is returned.  If VALUEP is NULL, don't
    fetch/compute the value.  Instead just return the location of the
    value.  */
-extern void frame_register_unwind (struct frame_info *frame, int regnum,
+extern void frame_register_unwind (frame_info *frame, int regnum,
                                   int *optimizedp, int *unavailablep,
                                   enum lval_type *lvalp,
                                   CORE_ADDR *addrp, int *realnump,
@@ -552,22 +571,22 @@ extern void frame_register_unwind (struct frame_info *frame, int regnum,
    fetch fails.  The value methods never return NULL, but usually
    do return a lazy value.  */
 
-extern void frame_unwind_register (struct frame_info *frame,
+extern void frame_unwind_register (frame_info *next_frame,
                                   int regnum, gdb_byte *buf);
 extern void get_frame_register (struct frame_info *frame,
                                int regnum, gdb_byte *buf);
 
-struct value *frame_unwind_register_value (struct frame_info *frame,
+struct value *frame_unwind_register_value (frame_info *next_frame,
                                           int regnum);
 struct value *get_frame_register_value (struct frame_info *frame,
                                        int regnum);
 
-extern LONGEST frame_unwind_register_signed (struct frame_info *frame,
+extern LONGEST frame_unwind_register_signed (frame_info *next_frame,
                                             int regnum);
 extern LONGEST get_frame_register_signed (struct frame_info *frame,
                                          int regnum);
-extern ULONGEST frame_unwind_register_unsigned (struct frame_info *frame,
-                                              int regnum);
+extern ULONGEST frame_unwind_register_unsigned (frame_info *frame,
+                                               int regnum);
 extern ULONGEST get_frame_register_unsigned (struct frame_info *frame,
                                             int regnum);
 
@@ -650,7 +669,7 @@ extern int safe_frame_unwind_memory (struct frame_info *this_frame,
 extern struct gdbarch *get_frame_arch (struct frame_info *this_frame);
 
 /* Return the previous frame's architecture.  */
-extern struct gdbarch *frame_unwind_arch (struct frame_info *frame);
+extern struct gdbarch *frame_unwind_arch (frame_info *next_frame);
 
 /* Return the previous frame's architecture, skipping inline functions.  */
 extern struct gdbarch *frame_unwind_caller_arch (struct frame_info *frame);
@@ -680,8 +699,9 @@ extern void *frame_obstack_zalloc (unsigned long size);
 #define FRAME_OBSTACK_CALLOC(NUMBER,TYPE) \
   ((TYPE *) frame_obstack_zalloc ((NUMBER) * sizeof (TYPE)))
 
+class readonly_detached_regcache;
 /* Create a regcache, and copy the frame's registers into it.  */
-std::unique_ptr<struct regcache> frame_save_as_regcache
+std::unique_ptr<readonly_detached_regcache> frame_save_as_regcache
     (struct frame_info *this_frame);
 
 extern const struct block *get_frame_block (struct frame_info *,
@@ -786,11 +806,11 @@ extern void read_frame_arg (struct symbol *sym, struct frame_info *frame,
 extern void read_frame_local (struct symbol *sym, struct frame_info *frame,
                              struct frame_arg *argp);
 
-extern void info_args_command (char *, int);
+extern void info_args_command (const char *, int);
 
-extern void info_locals_command (char *, int);
+extern void info_locals_command (const char *, int);
 
-extern void return_command (char *, int);
+extern void return_command (const char *, int);
 
 /* Set FRAME's unwinder temporarily, so that we can call a sniffer.
    If sniffing fails, the caller should be sure to call
This page took 0.025219 seconds and 4 git commands to generate.