1 /*
   2  * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores,
  20  * CA 94065 USA or visit www.oracle.com if you need additional information or
  21  * have any questions.
  22  *
  23  */
  24 
  25 package sun.jvm.hotspot.debugger.cdbg;
  26 
  27 import sun.jvm.hotspot.debugger.*;
  28 
  29 /** Models a "C" programming language frame on the stack -- really
  30     just an arbitrary frame with hooks to access C and C++ debug
  31     information if available. It is recommended that implementors of
  32     this interface derive from BasicCFrame, which provides some of the
  33     functionality. */
  34 
  35 public interface CFrame {
  36   /** Returns null when no more frames on stack */
  37   public CFrame sender();
  38 
  39   /** Get the program counter of this frame */
  40   public Address pc();
  41 
  42   /** Get the loadobject in which the PC lies. Returns null if the PC
  43       is not contained in any of the loadobjects in the target
  44       process. */
  45   public LoadObject loadObjectForPC();
  46 
  47   /** If debug information is available, retrieves the block in which
  48       the program counter lies. Returns null if there is no debug
  49       information for the current program counter or if the PC could
  50       not be located for other reasons. */
  51   public BlockSym blockForPC();
  52 
  53   /** For the loadobject in which the PC lies, fetch the name of the
  54       closest exported symbol and the distance of the PC to that
  55       symbol. Returns null if the PC was not within any of the
  56       loadobjects of the target process. FIXME: specify whether this
  57       is mangled/demangled. */
  58   public ClosestSymbol closestSymbolToPC();
  59 
  60   /** Gets the base pointer in this frame from which local variable
  61       offsets in the debug info are based. Typically this is the
  62       base-of-frame pointer (EBP on x86, FP/I6 on SPARC). */
  63   public Address localVariableBase();
  64 
  65   /** Visit all local variables in this frame if debug information is
  66       available. Automatically descends into compound types and arrays. */
  67   public void iterateLocals(ObjectVisitor v);
  68 }