GDB (API)
/home/stan/gdb/src/gdb/frame-base.h
Go to the documentation of this file.
00001 /* Definitions for a frame base, for GDB, the GNU debugger.
00002 
00003    Copyright (C) 2003-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #if !defined (FRAME_BASE_H)
00021 #define FRAME_BASE_H 1
00022 
00023 struct frame_info;
00024 struct frame_id;
00025 struct frame_unwind;
00026 struct frame_base;
00027 struct gdbarch;
00028 struct regcache;
00029 
00030 /* Assuming the frame chain: (outer) prev <-> this <-> next (inner);
00031    and that this is a `normal frame'; use THIS frame, and implicitly
00032    the NEXT frame's register unwind method, to determine the address
00033    of THIS frame's `base'.
00034 
00035    The exact meaning of `base' is highly dependant on the type of the
00036    debug info.  It is assumed that dwarf2, stabs, ... will each
00037    provide their own methods.
00038 
00039    A typical implmentation will return the same value for base,
00040    locals-base and args-base.  That value, however, will likely be
00041    different to the frame ID's stack address.  */
00042 
00043 /* A generic base address.  */
00044 
00045 typedef CORE_ADDR (frame_this_base_ftype) (struct frame_info *this_frame,
00046                                            void **this_base_cache);
00047 
00048 /* The base address of the frame's local variables.  */
00049 
00050 typedef CORE_ADDR (frame_this_locals_ftype) (struct frame_info *this_frame,
00051                                              void **this_base_cache);
00052 
00053 /* The base address of the frame's arguments / parameters.  */
00054 
00055 typedef CORE_ADDR (frame_this_args_ftype) (struct frame_info *this_frame,
00056                                            void **this_base_cache);
00057 
00058 struct frame_base
00059 {
00060   /* If non-NULL, a low-level unwinder that shares its implementation
00061      with this high-level frame-base method.  */
00062   const struct frame_unwind *unwind;
00063   frame_this_base_ftype *this_base;
00064   frame_this_locals_ftype *this_locals;
00065   frame_this_args_ftype *this_args;
00066 };
00067 
00068 /* Given THIS frame, return the frame base methods for THIS frame,
00069    or NULL if it can't handle THIS frame.  */
00070 
00071 typedef const struct frame_base *(frame_base_sniffer_ftype) (struct frame_info *this_frame);
00072 
00073 /* Append a frame base sniffer to the list.  The sniffers are polled
00074    in the order that they are appended.  */
00075 
00076 extern void frame_base_append_sniffer (struct gdbarch *gdbarch,
00077                                        frame_base_sniffer_ftype *sniffer);
00078 
00079 /* Set the default frame base.  If all else fails, this one is
00080    returned.  If this isn't set, the default is to use legacy code
00081    that uses things like the frame ID's base (ulgh!).  */
00082 
00083 extern void frame_base_set_default (struct gdbarch *gdbarch,
00084                                     const struct frame_base *def);
00085 
00086 /* Iterate through the list of frame base handlers until one returns
00087    an implementation.  */
00088 
00089 extern const struct frame_base *frame_base_find_by_frame (struct frame_info *this_frame);
00090 
00091 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines