gdb/testsuite/
[binutils-gdb.git] / gdb / frame-unwind.h
index 9ffafffb26fb742b239c581f04b97fb93df45a04..e4cf3201c091d9bda08c38a35b01502e80e18abf 100644 (file)
@@ -1,6 +1,7 @@
 /* Definitions for a frame unwinder, for GDB, the GNU debugger.
 
 /* Definitions for a frame unwinder, for GDB, the GNU debugger.
 
-   Copyright (C) 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
 
    This file is part of GDB.
 
@@ -32,8 +33,8 @@ struct value;
 
 /* The following unwind functions assume a chain of frames forming the
    sequence: (outer) prev <-> this <-> next (inner).  All the
 
 /* The following unwind functions assume a chain of frames forming the
    sequence: (outer) prev <-> this <-> next (inner).  All the
-   functions are called with called with the next frame's `struct
-   frame_info' and and this frame's prologue cache.
+   functions are called with the next frame's `struct frame_info'
+   and this frame's prologue cache.
 
    THIS frame's register values can be obtained by unwinding NEXT
    frame's registers (a recursive operation).
 
    THIS frame's register values can be obtained by unwinding NEXT
    frame's registers (a recursive operation).
@@ -121,6 +122,13 @@ typedef struct value * (frame_prev_register_ftype)
 typedef void (frame_dealloc_cache_ftype) (struct frame_info *self,
                                          void *this_cache);
 
 typedef void (frame_dealloc_cache_ftype) (struct frame_info *self,
                                          void *this_cache);
 
+/* Assuming the frame chain: (outer) prev <-> this <-> next (inner);
+   use THIS frame, and implicitly the NEXT frame's register unwind
+   method, return PREV frame's architecture.  */
+
+typedef struct gdbarch *(frame_prev_arch_ftype) (struct frame_info *this_frame,
+                                                void **this_prologue_cache);
+
 struct frame_unwind
 {
   /* The frame's type.  Should this instead be a collection of
 struct frame_unwind
 {
   /* The frame's type.  Should this instead be a collection of
@@ -133,6 +141,7 @@ struct frame_unwind
   const struct frame_data *unwind_data;
   frame_sniffer_ftype *sniffer;
   frame_dealloc_cache_ftype *dealloc_cache;
   const struct frame_data *unwind_data;
   frame_sniffer_ftype *sniffer;
   frame_dealloc_cache_ftype *dealloc_cache;
+  frame_prev_arch_ftype *prev_arch;
 };
 
 /* Register a frame unwinder, _prepending_ it to the front of the
 };
 
 /* Register a frame unwinder, _prepending_ it to the front of the
@@ -151,11 +160,12 @@ extern void frame_unwind_prepend_unwinder (struct gdbarch *gdbarch,
 extern void frame_unwind_append_unwinder (struct gdbarch *gdbarch,
                                          const struct frame_unwind *unwinder);
 
 extern void frame_unwind_append_unwinder (struct gdbarch *gdbarch,
                                          const struct frame_unwind *unwinder);
 
-/* Iterate through sniffers for THIS frame until one returns with an
-   unwinder implementation.  Possibly initialize THIS_CACHE.  */
+/* Iterate through sniffers for THIS_FRAME frame until one returns with an
+   unwinder implementation.  THIS_FRAME->UNWIND must be NULL, it will get set
+   by this function.  Possibly initialize THIS_CACHE.  */
 
 
-extern const struct frame_unwind *frame_unwind_find_by_frame (struct frame_info *this_frame,
-                                                             void **this_cache);
+extern void frame_unwind_find_by_frame (struct frame_info *this_frame,
+                                       void **this_cache);
 
 /* Helper functions for value-based register unwinding.  These return
    a (possibly lazy) value of the appropriate type.  */
 
 /* Helper functions for value-based register unwinding.  These return
    a (possibly lazy) value of the appropriate type.  */
@@ -183,6 +193,13 @@ struct value *frame_unwind_got_memory (struct frame_info *frame, int regnum,
 struct value *frame_unwind_got_constant (struct frame_info *frame, int regnum,
                                         ULONGEST val);
 
 struct value *frame_unwind_got_constant (struct frame_info *frame, int regnum,
                                         ULONGEST val);
 
+/* Return a value which indicates that FRAME's saved version of
+   REGNUM has a known constant (computed) value which is stored
+   inside BUF.  */
+
+struct value *frame_unwind_got_bytes (struct frame_info *frame, int regnum,
+                                      gdb_byte *buf);
+
 /* Return a value which indicates that FRAME's saved version of REGNUM
    has a known constant (computed) value of ADDR.  Convert the
    CORE_ADDR to a target address if necessary.  */
 /* Return a value which indicates that FRAME's saved version of REGNUM
    has a known constant (computed) value of ADDR.  Convert the
    CORE_ADDR to a target address if necessary.  */