1 /* 2 * Copyright (c) 2001, 2003, 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 java.util.*; 28 import sun.jvm.hotspot.debugger.*; 29 30 /** Interface describing how to debug C and C++ programs. Being kept 31 very minimal and incomplete for now; can be extended later. */ 32 33 public interface CDebugger { 34 /** Fetch the thread list for the target process as a List of 35 ThreadProxy objects. Do not mutate this list. Throws 36 DebuggerException if the target process is not suspended (via 37 ProcessControl) or if the fetch failed for some other reason. */ 38 public List/*<ThreadProxy>*/ getThreadList() throws DebuggerException; 39 40 /** Return a list of LoadObjects in the target process. Do not 41 mutate this list. Throws DebuggerException if the target process 42 is not suspended (via ProcessControl) or if the fetch failed for 43 some other reason. */ 44 public List/*<LoadObject>*/ getLoadObjectList() throws DebuggerException; 45 46 /** Fetch the loadobject containing the current program counter. 47 Returns null if the PC was outside the ranges of all loadobjects 48 in the target process. Throws DebuggerException if the target 49 process is not suspended (via ProcessControl) or if the fetch 50 failed for some other reason. */ 51 public LoadObject loadObjectContainingPC(Address pc) throws DebuggerException; 52 53 /** Create a CFrame object for the top frame of the given thread, 54 specified as a ThreadProxy. Returns null if there are no frames 55 on the stack or the frame can not be created for some other 56 reason. Throws DebuggerException if the target process is not 57 suspended (via ProcessControl). */ 58 public CFrame topFrameForThread(ThreadProxy t) 59 throws DebuggerException, IllegalThreadStateException; 60 61 /** Get the file name component for the given full path to a DLL. 62 (The path separator characters and behavior of File.getName() 63 are platform-specific.) */ 64 public String getNameOfFile(String fileName) throws DebuggerException; 65 66 /** Fetch a ProcessControl object for the target process, enabling 67 suspension, resumption and event handling. This method may 68 return null for many reasons, including that the underlying 69 implementation does not support process interaction, or that the 70 target process is dead (i.e., a core file). */ 71 public ProcessControl getProcessControl() throws DebuggerException; 72 73 /** is demangling of C++ symbols supported by this CDebugger? */ 74 public boolean canDemangle(); 75 76 /** Demangle C++ symbols into readable strings, if possible. 77 otherwise returns the input symbol back. */ 78 public String demangle(String sym) throws UnsupportedOperationException; 79 }