1 /******************************************************************************* 2 * Copyright (c) 2000, 2010 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 package org.eclipse.debug.core.model; 15 16 17 import org.eclipse.debug.core.DebugException; 18 import org.eclipse.debug.core.IBreakpointListener; 19 20 /** 21 * A debug target is a debuggable execution context. For example, a debug target 22 * may represent a debuggable process or a virtual machine. A debug target is the root 23 * of the debug element hierarchy. A debug target contains threads. Minimally, a debug 24 * target supports the following: 25 * <ul> 26 * <li>terminate 27 * <li>suspend/resume 28 * <li>breakpoints 29 * <li>disconnect 30 * </ul> 31 * <p> 32 * Generally, launching a debug session results in the creation of a 33 * debug target. Launching is a client responsibility, as is debug target 34 * creation. 35 * <p> 36 * Clients may implement this interface. 37 * </p> 38 * @see ITerminate 39 * @see ISuspendResume 40 * @see IBreakpointListener 41 * @see IDisconnect 42 * @see IMemoryBlockRetrieval 43 * @see org.eclipse.debug.core.ILaunch 44 */ 45 public interface IDebugTarget extends IDebugElement, ITerminate, ISuspendResume, IBreakpointListener, IDisconnect, IMemoryBlockRetrieval { 46 /** 47 * Returns the system process associated with this debug target. 48 * 49 * @return the system process associated with this debug target 50 */ getProcess()51 IProcess getProcess(); 52 /** 53 * Returns the threads contained in this debug target. An 54 * empty collection is returned if this debug target contains 55 * no threads. 56 * 57 * @return a collection of threads 58 * @exception DebugException if this method fails. Reasons include: 59 * <ul><li>Failure communicating with the debug target. The DebugException's 60 * status code contains the underlying exception responsible for 61 * the failure.</li></ul> 62 * @since 2.0 63 */ getThreads()64 IThread[] getThreads() throws DebugException; 65 66 /** 67 * Returns whether this debug target currently contains any threads. 68 * 69 * @return whether this debug target currently contains any threads 70 * @exception DebugException if this method fails. Reasons include: 71 * <ul><li>Failure communicating with the debug target. The DebugException's 72 * status code contains the underlying exception responsible for 73 * the failure.</li></ul> 74 * @since 2.0 75 */ hasThreads()76 boolean hasThreads() throws DebugException; 77 78 /** 79 * Returns the name of this debug target. Name format is debug model 80 * specific, and should be specified by a debug model. 81 * 82 * @return this target's name 83 * @exception DebugException if this method fails. Reasons include: 84 * <ul><li>Failure communicating with the debug target. The DebugException's 85 * status code contains the underlying exception responsible for 86 * the failure.</li></ul> 87 */ getName()88 String getName() throws DebugException; 89 90 /** 91 * Returns whether this target can install the given breakpoint. 92 * 93 * @param breakpoint breakpoint to consider 94 * @return whether this target can install the given breakpoint 95 */ supportsBreakpoint(IBreakpoint breakpoint)96 boolean supportsBreakpoint(IBreakpoint breakpoint); 97 } 98 99 100