Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 61d9a2a0ba807cda91bfc72cc0b2da4ae0eaf6c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*******************************************************************************
 * Copyright (c) 2010 Freescale Semiconductor and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Freescale Semiconductor - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.debug.internal.core;

import org.eclipse.debug.core.IRequest;

/**
 * View model types for which the "Add Watchpoint (C/C++)" action is applicable
 * should implement this interface. The action is a popupMenu/objectContribution
 * that targets this type.
 * 
 * <p>
 * Note that the action is particular to CBreakpoint, and not all CDT debugger
 * solutions use CBreakpoint.
 */
public interface ICWatchpointTarget {

	/** IRequest object used in the asynchronous method {@link ICWatchpointTarget#getSize()} */
	interface GetSizeRequest extends IRequest {
		int getSize(); // returns -1 if size not available
		void setSize(int size);
	};
	
	interface CanCreateWatchpointRequest extends IRequest {
		boolean getCanCreate();
		void setCanCreate(boolean value);
	};

	/**
	 * Determine if a watchpoint can be set on the element. The result does not
	 * guarantee an attempt to set such a watchpoint will succeed. This is
	 * merely a way to find out whether it makes sense to even attempt it. For
	 * example, an expression that's not an l-value should return false. The
	 * implementation may choose to go even further and check that the target
	 * supports watchpoints (at all or at that particular location).
	 */
	void canSetWatchpoint(CanCreateWatchpointRequest request);
	
	/**
	 * Get the expression or the name of the variable
	 */
	String getExpression();

	/**
	 * Asynchronous method to retrieve the size of the variable/expression, in
	 * bytes.
	 * 
	 * @param request
	 *            the async request object
	 */
	void getSize(GetSizeRequest request);
}

Back to the top