Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 33346eef90d631642317033a03a38ed24a67fa78 (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
61
62
63
/*******************************************************************************
 * Copyright (c) 2010, 2012 Freescale Semiconductor and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     Freescale Semiconductor - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.debug.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.
 *
 * @since 7.2
 */
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