LoadObject.java revision 9883:903a2e023ffb
1238384Sjkim/*
2238384Sjkim * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
3238384Sjkim * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4238384Sjkim *
5238384Sjkim * This code is free software; you can redistribute it and/or modify it
6238384Sjkim * under the terms of the GNU General Public License version 2 only, as
7238384Sjkim * published by the Free Software Foundation.
8238384Sjkim *
9238384Sjkim * This code is distributed in the hope that it will be useful, but WITHOUT
10238384Sjkim * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11238384Sjkim * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12238384Sjkim * version 2 for more details (a copy is included in the LICENSE file that
13238384Sjkim * accompanied this code).
14238384Sjkim *
15238384Sjkim * You should have received a copy of the GNU General Public License version
16238384Sjkim * 2 along with this work; if not, write to the Free Software Foundation,
17238384Sjkim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18238384Sjkim *
19238384Sjkim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20238384Sjkim * or visit www.oracle.com if you need additional information or have any
21238384Sjkim * questions.
22238384Sjkim *
23238384Sjkim */
24238384Sjkim
25238384Sjkimpackage sun.jvm.hotspot.debugger.cdbg;
26238384Sjkim
27238384Sjkimimport sun.jvm.hotspot.debugger.*;
28238384Sjkim
29238384Sjkim/** A LoadObject models a DSO/DLL/EXE; that is, an entity relocated by
30238384Sjkim    the run-time linker. */
31238384Sjkim
32238384Sjkimpublic interface LoadObject {
33238384Sjkim  /** Base address at which this loadobject was relocated at run-time */
34238384Sjkim  public Address getBase();
35238384Sjkim
36238384Sjkim  /** Full path name of this loadobject */
37238384Sjkim  public String getName();
38238384Sjkim
39238384Sjkim  /** Size of the loadobject in bytes (determines the range of program
40238384Sjkim      counters and data contained within this loadobject) */
41238384Sjkim  public long getSize();
42238384Sjkim
43238384Sjkim  /** Returns a debug info database for this loadobject if debug info
44238384Sjkim      is present; otherwise, returns null. */
45238384Sjkim  public CDebugInfoDataBase getDebugInfoDataBase() throws DebuggerException;
46238384Sjkim
47238384Sjkim  /** Get debug information for the given program counter. PC must be
48238384Sjkim      contained within this loadobject or a DebuggerException is
49238384Sjkim      thrown. Returns null if there is no debug information available
50238384Sjkim      (i.e., because this is not a debug build). */
51238384Sjkim  public BlockSym debugInfoForPC(Address pc) throws DebuggerException;
52238384Sjkim
53238384Sjkim  /** Fetch the name of the closest exported symbol and the distance
54238384Sjkim      of the PC to that symbol. Returns null if the PC was not within
55238384Sjkim      this loadobject or if a symbol could not be found before this
56238384Sjkim      PC. FIXME: specify whether this is mangled/demangled. */
57238384Sjkim  public ClosestSymbol closestSymbolToPC(Address pc) throws DebuggerException;
58238384Sjkim
59238384Sjkim  /** Returns line number information for the given PC, including
60238384Sjkim      source file name (not specified whether this is an absolute or
61238384Sjkim      relative path) and start and end PCs for this line. Returns null
62238384Sjkim      if no line number information is available or if the given PC is
63238384Sjkim      not in this loadobject. */
64238384Sjkim  public LineNumberInfo lineNumberForPC(Address pc) throws DebuggerException;
65238384Sjkim}
66238384Sjkim