Skip to main content
summaryrefslogtreecommitdiffstats
blob: a5abff7455c7f313cb609aa244217b6a3eb7897c (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*******************************************************************************
 * Copyright (c) 2000, 2004 QNX Software Systems and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     QNX Software Systems - Initial API and implementation
 *******************************************************************************/

package org.eclipse.cdt.debug.core.cdi;

import org.eclipse.cdt.debug.core.cdi.model.ICDITracepoint;

/**
 * Manages the collection of registered tracepoints and trace snapshoits 
 * in the debug session. Provides methods to control tracing.
 * 
 * @since May 15, 2003
 */
public interface ICDITraceManager extends ICDISessionObject {
	/**
	 * Returns a collection of all tracepoints set for this session. 
	 * Returns an empty array if no tracepoints are set.
	 * 
	 * @return a collection of all tracepoints set for this session
	 * @throws CDIException on failure. Reasons include:
	 */
	ICDITracepoint[] getTracepoints() throws CDIException;

	/**
	 * Deletes the given tracepoint.
	 * 
	 * @param tracepoint - a tracepoint to be deleted
	 * @throws CDIException on failure. Reasons include:
	 */
	void deleteTracepoint( ICDITracepoint tracepoint ) throws CDIException;

	/**
	 * Deletes the given array of tracepoints.
	 * 
	 * @param tracepoints - the array of tracepoints to be deleted
	 * @throws CDIException on failure. Reasons include:
	 */
	void deleteTracepoints( ICDITracepoint[] tracepoints ) throws CDIException;

	/**
	 * Deletes all tracepoints.
	 * 
	 * @throws CDIException on failure. Reasons include:
	 */
	void deleteAllTracepoints() throws CDIException;

	/**
	 * Sets a tracepoint at the given location.
	 * The tracepoint is set acording to the choices:
	 * <pre>
	 * if location.getFile() != null then
	 *    if location.getFunction() != null then
	 *       tracepoint = file:function
	 *    else
	 *       tracepoint = file:line
	 * else if (location.getFuntion() != null) then
	 *    tracepoint = function
	 * else if (location.getLineNumber() != 0 then
	 *    tracepoint = line
	 * else
	 *    tracepoint = address
	 * end
	 * </pre> 
	 * 
	 * @param location - the location 
	 * @return a tracepoint
	 * @throws CDIException on failure. Reasons include:
	 */
	ICDITracepoint setTracepoint( ICDILocation location ) throws CDIException;

	/**
	 * Allows the manager to interrupt the excution of program
	 * when setting a tracepoint.
	 */
	void allowProgramInterruption( boolean allow );

	/**
	 * Starts the tracing and begins collecting data.
	 * 
	 * @throws CDIException on failure. Reasons include:
	 */
	void startTracing() throws CDIException;

	/**
	 * Stops the tracing and ends collecting data.
	 * 
	 * @throws CDIException on failure. Reasons include:
	 */
	void stopTracing() throws CDIException;

	/**
	 * Returns the status of tracing.
	 * 
	 * @return the status of tracing
	 * @throws CDIException on failure. Reasons include:
	 */
	boolean isTracing() throws CDIException;

	/**
	 * Enables/disables the snapshot debugging mode.
	 * 
	 * @param enabled <code>true</code> to enable, and <code>false</code> 
	 * to disable
	 * @throws CDIException on failure. Reasons include:
	 */
	void enableSnapshotMode( boolean enabled ) throws CDIException;

	/**
	 * Returns all trace snapshots for this session.
	 * 
	 * @return all trace snapshots for this session
	 * @throws CDIException on failure. Reasons include:
	 */
	ICDITraceSnapshot[] getSnapshots() throws CDIException;

	/**
	 * Returns all trace snapshots associated with the given tracepoints.
	 * 
	 * @param tracepoints - an array of tracepoints
	 * @return all trace snapshots associated with the given tracepoints
	 * @throws CDIException on failure. Reasons include:
	 */
	ICDITraceSnapshot[] getSnapshots( ICDITracepoint[] tracepoints ) throws CDIException;

	/**
	 * Returns all trace snapshots associated with the given locations.
	 * 
	 * @param locations - an array of locations
	 * @return all trace snapshots associated with the given locations
	 * @throws CDIException on failure. Reasons include:
	 */
	ICDITraceSnapshot[] getSnapshots( ICDILocation[] locations ) throws CDIException;

	/**
	 * Creates an ICDILocation object for given file name and line number or function.
	 * 
	 * @param file - a file name
	 * @param function - a function name
	 * @param line - a line number
	 * @return an ICDILocation object 
	 */
	ICDILocation createLocation( String file, String function, int line );

	/**
	 * Creates an ICDILocation object for given address.
	 * 
	 * @param address - an address
	 * @return an ICDILocation object 
	 */
	ICDILocation createLocation( long address );
}

Back to the top