mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 10:45:37 +02:00
Bug 346320: Add support for fast tracepoints
This commit is contained in:
parent
03824cc6ca
commit
d592d691aa
9 changed files with 1380 additions and 733 deletions
|
@ -9,6 +9,7 @@
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
* Ericsson - Modified for DSF
|
* Ericsson - Modified for DSF
|
||||||
* Sergey Prigogin (Google)
|
* Sergey Prigogin (Google)
|
||||||
|
* Marc Khouzam (Ericsson) - Support for fast tracepoints (Bug 346320)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.internal.ui.launching;
|
package org.eclipse.cdt.dsf.gdb.internal.ui.launching;
|
||||||
|
|
||||||
|
@ -30,9 +31,11 @@ import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
import org.eclipse.swt.events.ModifyListener;
|
||||||
import org.eclipse.swt.events.SelectionAdapter;
|
import org.eclipse.swt.events.SelectionAdapter;
|
||||||
import org.eclipse.swt.events.SelectionEvent;
|
import org.eclipse.swt.events.SelectionEvent;
|
||||||
|
import org.eclipse.swt.events.SelectionListener;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.FileDialog;
|
import org.eclipse.swt.widgets.FileDialog;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
|
@ -54,6 +57,14 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
protected Button fUpdateThreadlistOnSuspend;
|
protected Button fUpdateThreadlistOnSuspend;
|
||||||
protected Button fDebugOnFork;
|
protected Button fDebugOnFork;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A combo box to let the user choose if fast tracepoints should be used or not.
|
||||||
|
*/
|
||||||
|
protected Combo fTracepointModeCombo;
|
||||||
|
protected static final String TP_FAST_ONLY = LaunchUIMessages.getString("GDBDebuggerPage.tracepoint_mode_fast"); //$NON-NLS-1$
|
||||||
|
protected static final String TP_SLOW_ONLY = LaunchUIMessages.getString("GDBDebuggerPage.tracepoint_mode_slow"); //$NON-NLS-1$
|
||||||
|
protected static final String TP_AUTOMATIC = LaunchUIMessages.getString("GDBDebuggerPage.tracepoint_mode_auto"); //$NON-NLS-1$
|
||||||
|
|
||||||
private IMILaunchConfigurationComponent fSolibBlock;
|
private IMILaunchConfigurationComponent fSolibBlock;
|
||||||
private boolean fIsInitializing = false;
|
private boolean fIsInitializing = false;
|
||||||
|
|
||||||
|
@ -82,6 +93,8 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
|
||||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
|
||||||
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
||||||
|
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
|
||||||
|
|
||||||
if (fSolibBlock != null)
|
if (fSolibBlock != null)
|
||||||
fSolibBlock.setDefaults(configuration);
|
fSolibBlock.setDefaults(configuration);
|
||||||
|
@ -142,9 +155,45 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
fUpdateThreadlistOnSuspend.setSelection(updateThreadsOnSuspend);
|
fUpdateThreadlistOnSuspend.setSelection(updateThreadsOnSuspend);
|
||||||
fDebugOnFork.setSelection(debugOnFork);
|
fDebugOnFork.setSelection(debugOnFork);
|
||||||
|
|
||||||
|
updateTracepointModeFromConfig(configuration);
|
||||||
|
|
||||||
setInitializing(false);
|
setInitializing(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void updateTracepointModeFromConfig(ILaunchConfiguration config) {
|
||||||
|
if (fTracepointModeCombo != null) {
|
||||||
|
String tracepointMode = getStringAttr(config, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
||||||
|
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
|
||||||
|
|
||||||
|
if (tracepointMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_SLOW_ONLY)) {
|
||||||
|
fTracepointModeCombo.setText(TP_SLOW_ONLY);
|
||||||
|
} else if (tracepointMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_ONLY)) {
|
||||||
|
fTracepointModeCombo.setText(TP_FAST_ONLY);
|
||||||
|
} else if (tracepointMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_SLOW)) {
|
||||||
|
fTracepointModeCombo.setText(TP_AUTOMATIC);
|
||||||
|
} else {
|
||||||
|
assert false : "Unknown Tracepoint Mode: " + tracepointMode; //$NON-NLS-1$
|
||||||
|
fTracepointModeCombo.setText(TP_SLOW_ONLY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected String getSelectedTracepointMode() {
|
||||||
|
if (fTracepointModeCombo != null) {
|
||||||
|
int selectedIndex = fTracepointModeCombo.getSelectionIndex();
|
||||||
|
if (fTracepointModeCombo.getItem(selectedIndex).equals(TP_SLOW_ONLY)) {
|
||||||
|
return IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_SLOW_ONLY;
|
||||||
|
} else if (fTracepointModeCombo.getItem(selectedIndex).equals(TP_FAST_ONLY)) {
|
||||||
|
return IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_ONLY;
|
||||||
|
} else if (fTracepointModeCombo.getItem(selectedIndex).equals(TP_AUTOMATIC)) {
|
||||||
|
return IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_SLOW;
|
||||||
|
} else {
|
||||||
|
assert false : "Unknown Tracepoint mode: " + fTracepointModeCombo.getItem(selectedIndex); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
|
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
|
||||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
|
||||||
fGDBCommandText.getText().trim());
|
fGDBCommandText.getText().trim());
|
||||||
|
@ -158,6 +207,12 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
fUpdateThreadlistOnSuspend.getSelection());
|
fUpdateThreadlistOnSuspend.getSelection());
|
||||||
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
|
||||||
fDebugOnFork.getSelection());
|
fDebugOnFork.getSelection());
|
||||||
|
|
||||||
|
if (fTracepointModeCombo != null) {
|
||||||
|
configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
||||||
|
getSelectedTracepointMode());
|
||||||
|
}
|
||||||
|
|
||||||
if (fSolibBlock != null)
|
if (fSolibBlock != null)
|
||||||
fSolibBlock.performApply(configuration);
|
fSolibBlock.performApply(configuration);
|
||||||
}
|
}
|
||||||
|
@ -307,6 +362,30 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
|
||||||
PlatformUI.getWorkbench().getHelpSystem().setHelp(fUpdateThreadlistOnSuspend, GdbUIPlugin.PLUGIN_ID + ".update_threadlist_button_context"); //$NON-NLS-1$
|
PlatformUI.getWorkbench().getHelpSystem().setHelp(fUpdateThreadlistOnSuspend, GdbUIPlugin.PLUGIN_ID + ".update_threadlist_button_context"); //$NON-NLS-1$
|
||||||
|
|
||||||
fDebugOnFork = addCheckbox(subComp, LaunchUIMessages.getString("GDBDebuggerPage.Automatically_debug_forked_processes")); //$NON-NLS-1$
|
fDebugOnFork = addCheckbox(subComp, LaunchUIMessages.getString("GDBDebuggerPage.Automatically_debug_forked_processes")); //$NON-NLS-1$
|
||||||
|
|
||||||
|
createTracepointModeCombo(subComp);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void createTracepointModeCombo(Composite parent) {
|
||||||
|
// Add a combo to choose the type of tracepoint mode to use
|
||||||
|
Label label = ControlFactory.createLabel(parent, LaunchUIMessages.getString("GDBDebuggerPage.tracepoint_mode_label")); //$NON-NLS-1$
|
||||||
|
label.setLayoutData(new GridData());
|
||||||
|
|
||||||
|
fTracepointModeCombo = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
|
||||||
|
fTracepointModeCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
|
||||||
|
fTracepointModeCombo.add(TP_SLOW_ONLY);
|
||||||
|
fTracepointModeCombo.add(TP_FAST_ONLY);
|
||||||
|
fTracepointModeCombo.add(TP_AUTOMATIC);
|
||||||
|
|
||||||
|
fTracepointModeCombo.addSelectionListener(new SelectionListener() {
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
updateLaunchConfigurationDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void widgetDefaultSelected(SelectionEvent e) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
fTracepointModeCombo.select(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void createSolibTab(TabFolder tabFolder) {
|
public void createSolibTab(TabFolder tabFolder) {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
# Contributors:
|
# Contributors:
|
||||||
# QNX Software Systems - initial API and implementation
|
# QNX Software Systems - initial API and implementation
|
||||||
# Ericsson - Updated for DSF
|
# Ericsson - Updated for DSF
|
||||||
|
# Marc Khouzam (Ericsson) - Support for fast tracepoints (Bug 346320)
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
GDBDebuggerPage.gdb_executable_not_specified=Debugger executable must be specified.
|
GDBDebuggerPage.gdb_executable_not_specified=Debugger executable must be specified.
|
||||||
|
@ -25,6 +26,10 @@ GDBDebuggerPage.nonstop_mode=Non-stop mode (Note: Requires non-stop GDB)
|
||||||
GDBDebuggerPage.reverse_Debugging=Enable Reverse Debugging at startup (Note: Requires Reverse GDB)
|
GDBDebuggerPage.reverse_Debugging=Enable Reverse Debugging at startup (Note: Requires Reverse GDB)
|
||||||
GDBDebuggerPage.update_thread_list_on_suspend=Force thread list update on suspend
|
GDBDebuggerPage.update_thread_list_on_suspend=Force thread list update on suspend
|
||||||
GDBDebuggerPage.Automatically_debug_forked_processes=Automatically debug forked processes (Note: Requires Multi Process GDB)
|
GDBDebuggerPage.Automatically_debug_forked_processes=Automatically debug forked processes (Note: Requires Multi Process GDB)
|
||||||
|
GDBDebuggerPage.tracepoint_mode_label=Tracepoint mode:
|
||||||
|
GDBDebuggerPage.tracepoint_mode_fast=Fast
|
||||||
|
GDBDebuggerPage.tracepoint_mode_slow=Slow
|
||||||
|
GDBDebuggerPage.tracepoint_mode_auto=Automatic
|
||||||
StandardGDBDebuggerPage.0=Debugger executable must be specified.
|
StandardGDBDebuggerPage.0=Debugger executable must be specified.
|
||||||
StandardGDBDebuggerPage.1=GDB Debugger Options
|
StandardGDBDebuggerPage.1=GDB Debugger Options
|
||||||
StandardGDBDebuggerPage.2=Main
|
StandardGDBDebuggerPage.2=Main
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Ericsson - initial API and implementation
|
* Ericsson - initial API and implementation
|
||||||
|
* Marc Khouzam (Ericsson) - Support for fast tracepoints (Bug 346320)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb;
|
package org.eclipse.cdt.dsf.gdb;
|
||||||
|
|
||||||
|
@ -105,6 +106,12 @@ public class IGDBLaunchConfigurationConstants {
|
||||||
*/
|
*/
|
||||||
public static final String ATTR_DEBUGGER_DEBUG_ON_FORK = GdbPlugin.PLUGIN_ID + ".DEBUG_ON_FORK"; //$NON-NLS-1$
|
public static final String ATTR_DEBUGGER_DEBUG_ON_FORK = GdbPlugin.PLUGIN_ID + ".DEBUG_ON_FORK"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Launch configuration attribute key. The value is a String specifying the type of Tracepoint mode
|
||||||
|
* that should be used for this launch.
|
||||||
|
* @since 4.1
|
||||||
|
*/
|
||||||
|
public static final String ATTR_DEBUGGER_TRACEPOINT_MODE = GdbPlugin.PLUGIN_ID + ".TRACEPOINT_MODE"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch configuration attribute value. The key is ATTR_DEBUG_NAME.
|
* Launch configuration attribute value. The key is ATTR_DEBUG_NAME.
|
||||||
|
@ -175,5 +182,32 @@ public class IGDBLaunchConfigurationConstants {
|
||||||
*/
|
*/
|
||||||
public static final boolean DEBUGGER_DEBUG_ON_FORK_DEFAULT = false;
|
public static final boolean DEBUGGER_DEBUG_ON_FORK_DEFAULT = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible attribute value for the key is ATTR_DEBUGGER_TRACEPOINT_MODE.
|
||||||
|
* Indicates that only slow tracepoints should be used.
|
||||||
|
* @since 4.1
|
||||||
|
*/
|
||||||
|
public static final String DEBUGGER_TRACEPOINT_SLOW_ONLY = "TP_SLOW_ONLY"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible attribute value for the key is ATTR_DEBUGGER_TRACEPOINT_MODE.
|
||||||
|
* Indicates that only fast tracepoints should be used.
|
||||||
|
* @since 4.1
|
||||||
|
*/
|
||||||
|
public static final String DEBUGGER_TRACEPOINT_FAST_ONLY = "TP_FAST_ONLY"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Possible attribute value for the key is ATTR_DEBUGGER_TRACEPOINT_MODE.
|
||||||
|
* Indicates that slow tracepoints should be used whenever a fast tracepoint
|
||||||
|
* cannot be inserted.
|
||||||
|
* @since 4.1
|
||||||
|
*/
|
||||||
|
public static final String DEBUGGER_TRACEPOINT_FAST_THEN_SLOW = "TP_FAST_THEN_SLOW"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default attribute value for the key is ATTR_DEBUGGER_TRACEPOINT_MODE.
|
||||||
|
* @since 4.1
|
||||||
|
*/
|
||||||
|
public static final String DEBUGGER_TRACEPOINT_MODE_DEFAULT = DEBUGGER_TRACEPOINT_SLOW_ONLY;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Ericsson - Initial API and implementation
|
* Ericsson - Initial API and implementation
|
||||||
|
* Marc Khouzam (Ericsson) - Support for fast tracepoints (Bug 346320)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.service;
|
package org.eclipse.cdt.dsf.gdb.service;
|
||||||
|
|
||||||
|
@ -20,18 +21,22 @@ import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
|
||||||
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
import org.eclipse.cdt.dsf.datamodel.IDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IBreakpoints;
|
import org.eclipse.cdt.dsf.debug.service.IBreakpoints;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IBreakpointsExtension;
|
import org.eclipse.cdt.dsf.debug.service.IBreakpointsExtension;
|
||||||
|
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||||
import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
|
import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
|
||||||
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData;
|
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData;
|
||||||
import org.eclipse.cdt.dsf.mi.service.MIBreakpoints;
|
import org.eclipse.cdt.dsf.mi.service.MIBreakpoints;
|
||||||
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo;
|
import org.eclipse.cdt.dsf.mi.service.command.output.MIBreakInsertInfo;
|
||||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||||
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
import org.eclipse.debug.core.ILaunch;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Breakpoint service for GDB 7.2.
|
* Breakpoint service for GDB 7.2.
|
||||||
* It support MI for tracepoints.
|
* It support MI for tracepoints.
|
||||||
|
* It also support for fast vs slow tracepoints.
|
||||||
*
|
*
|
||||||
* @since 4.1
|
* @since 4.1
|
||||||
*/
|
*/
|
||||||
|
@ -39,6 +44,10 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0
|
||||||
{
|
{
|
||||||
private IMICommandControl fConnection;
|
private IMICommandControl fConnection;
|
||||||
|
|
||||||
|
private enum TracepointMode { FAST_THEN_SLOW, FAST_ONLY, SLOW_ONLY };
|
||||||
|
|
||||||
|
private TracepointMode fTracepointMode = TracepointMode.SLOW_ONLY;
|
||||||
|
|
||||||
public GDBBreakpoints_7_2(DsfSession session) {
|
public GDBBreakpoints_7_2(DsfSession session) {
|
||||||
super(session);
|
super(session);
|
||||||
}
|
}
|
||||||
|
@ -60,6 +69,8 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0
|
||||||
// Get the services references
|
// Get the services references
|
||||||
fConnection = getServicesTracker().getService(IMICommandControl.class);
|
fConnection = getServicesTracker().getService(IMICommandControl.class);
|
||||||
|
|
||||||
|
setTracepointMode();
|
||||||
|
|
||||||
// Register this service
|
// Register this service
|
||||||
register(new String[] { IBreakpoints.class.getName(),
|
register(new String[] { IBreakpoints.class.getName(),
|
||||||
IBreakpointsExtension.class.getName(),
|
IBreakpointsExtension.class.getName(),
|
||||||
|
@ -77,12 +88,28 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0
|
||||||
super.shutdown(requestMonitor);
|
super.shutdown(requestMonitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private void setTracepointMode() {
|
||||||
* Add a tracepoint using MI
|
ILaunch launch = (ILaunch)getSession().getModelAdapter(ILaunch.class);
|
||||||
*/
|
String tpMode = IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT;
|
||||||
@Override
|
try {
|
||||||
protected void addTracepoint(final IBreakpointsTargetDMContext context, final Map<String, Object> attributes, final DataRequestMonitor<IBreakpointDMContext> drm)
|
tpMode = launch.getLaunchConfiguration().getAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
||||||
{
|
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
|
||||||
|
} catch (CoreException e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tpMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_ONLY)) {
|
||||||
|
fTracepointMode = TracepointMode.FAST_ONLY;
|
||||||
|
} else if (tpMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_SLOW_ONLY)) {
|
||||||
|
fTracepointMode = TracepointMode.SLOW_ONLY;
|
||||||
|
} else if (tpMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_SLOW)) {
|
||||||
|
fTracepointMode = TracepointMode.FAST_THEN_SLOW;
|
||||||
|
} else {
|
||||||
|
assert false : "Invalid tracepoint mode: " + tpMode; //$NON-NLS-1$
|
||||||
|
fTracepointMode = TracepointMode.SLOW_ONLY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void sendTracepointCommand(final IBreakpointsTargetDMContext context, final Map<String, Object> attributes, boolean isFastTracepoint, final DataRequestMonitor<IBreakpointDMContext> drm) {
|
||||||
// Select the context breakpoints map
|
// Select the context breakpoints map
|
||||||
final Map<Integer, MIBreakpointDMData> contextBreakpoints = getBreakpointMap(context);
|
final Map<Integer, MIBreakpointDMData> contextBreakpoints = getBreakpointMap(context);
|
||||||
if (contextBreakpoints == null) {
|
if (contextBreakpoints == null) {
|
||||||
|
@ -99,13 +126,11 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
final Boolean enabled = (Boolean) getProperty(attributes, MIBreakpoints.IS_ENABLED, true);
|
final Boolean enabled = (Boolean) getProperty(attributes, MIBreakpoints.IS_ENABLED, true);
|
||||||
final Boolean isHardware = (Boolean) getProperty(attributes, MIBreakpointDMData.IS_HARDWARE, false);
|
|
||||||
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
|
final String condition = (String) getProperty(attributes, MIBreakpoints.CONDITION, NULL_STRING);
|
||||||
|
|
||||||
fConnection.queueCommand(
|
fConnection.queueCommand(
|
||||||
fConnection.getCommandFactory().createMIBreakInsert(context, false, isHardware, condition, 0, location, 0, !enabled, true),
|
fConnection.getCommandFactory().createMIBreakInsert(context, false, isFastTracepoint, condition, 0, location, 0, !enabled, true),
|
||||||
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), drm) {
|
new DataRequestMonitor<MIBreakInsertInfo>(getExecutor(), drm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
|
@ -150,4 +175,37 @@ public class GDBBreakpoints_7_2 extends GDBBreakpoints_7_0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Add a tracepoint using MI. We have three settings:
|
||||||
|
* 1- set only a fast tracepoint but if it fails, set a slow tracepoint
|
||||||
|
* 2- only set a fast tracepoint even if it fails
|
||||||
|
* 3- only set a slow tracepoint even if a fast tracepoint could have been used
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void addTracepoint(final IBreakpointsTargetDMContext context, final Map<String, Object> attributes, final DataRequestMonitor<IBreakpointDMContext> drm) {
|
||||||
|
// Unless we should only set slow tracepoints, we try to set a fast tracepoint.
|
||||||
|
boolean isFastTracepoint = fTracepointMode != TracepointMode.SLOW_ONLY;
|
||||||
|
|
||||||
|
sendTracepointCommand(context, attributes, isFastTracepoint, new DataRequestMonitor<IBreakpointDMContext>(ImmediateExecutor.getInstance(), drm) {
|
||||||
|
@Override
|
||||||
|
protected void handleSuccess() {
|
||||||
|
// Tracepoint was set successfully.
|
||||||
|
drm.setData(getData());
|
||||||
|
drm.done();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void handleError() {
|
||||||
|
// Tracepoint failed to be set.
|
||||||
|
if (fTracepointMode == TracepointMode.FAST_THEN_SLOW) {
|
||||||
|
// In this case, we failed to set a fast tracepoint, but we should try to set a slow one.
|
||||||
|
sendTracepointCommand(context, attributes, false, drm);
|
||||||
|
} else {
|
||||||
|
// We either failed to set a fast tracepoint and we should not try to set a slow one,
|
||||||
|
// or we failed to set a slow one. Either way, we are done.
|
||||||
|
drm.setStatus(getStatus());
|
||||||
|
drm.done();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,7 +100,9 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected IBreakpoints createBreakpointService(DsfSession session) {
|
protected IBreakpoints createBreakpointService(DsfSession session) {
|
||||||
if (GDB_7_2_VERSION.compareTo(fVersion) <= 0) {
|
// This service is available for GDB 7.2 but there is a pre-release of GDB that
|
||||||
|
// supports the same features and has version of 6.8.50.20090414
|
||||||
|
if (GDB_7_2_VERSION.compareTo(fVersion) <= 0 || "6.8.50.20090414".equals(fVersion)) { //$NON-NLS-1$
|
||||||
return new GDBBreakpoints_7_2(session);
|
return new GDBBreakpoints_7_2(session);
|
||||||
}
|
}
|
||||||
if (GDB_7_0_VERSION.compareTo(fVersion) <= 0) {
|
if (GDB_7_0_VERSION.compareTo(fVersion) <= 0) {
|
||||||
|
@ -192,8 +194,8 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory {
|
||||||
|
|
||||||
/** @since 3.0 */
|
/** @since 3.0 */
|
||||||
protected IGDBTraceControl createTraceControlService(DsfSession session, ILaunchConfiguration config) {
|
protected IGDBTraceControl createTraceControlService(DsfSession session, ILaunchConfiguration config) {
|
||||||
// This service is available for GDB 7.2. But until that GDB is itself available
|
// This service is available for GDB 7.2 but there is a pre-release of GDB that
|
||||||
// there is a pre-release that has a version of 6.8.50.20090414
|
// supports the same features and has version of 6.8.50.20090414
|
||||||
if (GDB_7_2_VERSION.compareTo(fVersion) <= 0 || "6.8.50.20090414".equals(fVersion)) { //$NON-NLS-1$
|
if (GDB_7_2_VERSION.compareTo(fVersion) <= 0 || "6.8.50.20090414".equals(fVersion)) { //$NON-NLS-1$
|
||||||
return new GDBTraceControl_7_2(session, config);
|
return new GDBTraceControl_7_2(session, config);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@ package org.eclipse.cdt.dsf.mi.service.command.output;
|
||||||
|
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.dsf.gdb.internal.tracepointactions.TracepointActionManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Contain info about the GDB/MI breakpoint.
|
* Contain info about the GDB/MI breakpoint.
|
||||||
*
|
*
|
||||||
|
@ -498,7 +500,28 @@ public class MIBreakpoint {
|
||||||
} else if (var.equals("pending")) { //$NON-NLS-1$
|
} else if (var.equals("pending")) { //$NON-NLS-1$
|
||||||
// Only supported starting with GDB 6.8
|
// Only supported starting with GDB 6.8
|
||||||
pending = true;
|
pending = true;
|
||||||
|
} else if (var.equals("script")) { //$NON-NLS-1$
|
||||||
|
if (value instanceof MITuple) {
|
||||||
|
parseCommands((MITuple)value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void parseCommands(MITuple tuple) {
|
||||||
|
MIValue[] values = tuple.getMIValues();
|
||||||
|
StringBuffer cmds = new StringBuffer();
|
||||||
|
for (int i = 0; i < values.length; i++) {
|
||||||
|
MIValue value = values[i];
|
||||||
|
if (value != null && value instanceof MIConst) {
|
||||||
|
if (i > 0) {
|
||||||
|
// Insert a delimiter
|
||||||
|
cmds.append(TracepointActionManager.TRACEPOINT_ACTION_DELIMITER);
|
||||||
|
}
|
||||||
|
cmds.append(((MIConst)value).getCString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setCommands(cmds.toString());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,4 +1,12 @@
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
#include <process.h> // MinGW has no POSIX support; use MSVC runtime
|
||||||
|
#else
|
||||||
|
#include <pthread.h>
|
||||||
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "Sleep.h"
|
||||||
|
#define NUM_THREADS 5
|
||||||
|
|
||||||
int gIntVar = 543;
|
int gIntVar = 543;
|
||||||
double gDoubleVar = 543.543;
|
double gDoubleVar = 543.543;
|
||||||
|
@ -52,8 +60,21 @@ public:
|
||||||
Z z;
|
Z z;
|
||||||
};
|
};
|
||||||
|
|
||||||
void testTracepoints() {
|
#ifdef __MINGW32__
|
||||||
printf("Running TracepointTest App\n");
|
typedef unsigned int TID;
|
||||||
|
#else
|
||||||
|
typedef pthread_t TID;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
unsigned int __stdcall testTracepoints(void *threadid)
|
||||||
|
#else
|
||||||
|
void *testTracepoints(void *threadid)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
int tid = (int)threadid;
|
||||||
|
printf("Hello World! It's me, thread #%d!\n", tid);
|
||||||
|
|
||||||
int lIntVar = 12345;
|
int lIntVar = 12345;
|
||||||
double lDoubleVar = 12345.12345;
|
double lDoubleVar = 12345.12345;
|
||||||
|
@ -81,16 +102,53 @@ void testTracepoints() {
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
counter = 185;
|
printf("counter is now #%d!\n", counter);
|
||||||
|
|
||||||
// Large loop
|
// Large loop
|
||||||
for (counter=0; counter<10000;) {
|
for (; counter<10000;) {
|
||||||
counter++;
|
counter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SLEEP(2); // keep this thread around for a bit; the tests will check for its existence while the main thread is stopped at a breakpoint
|
||||||
|
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
return 0;
|
||||||
|
#else
|
||||||
|
pthread_exit(NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main() {
|
int main()
|
||||||
testTracepoints();
|
{
|
||||||
|
TID threads[NUM_THREADS];
|
||||||
|
int t;
|
||||||
|
for(t=0; t < NUM_THREADS; t++)
|
||||||
|
{
|
||||||
|
printf("In main: creating thread %d\n", t);
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
{
|
||||||
|
uintptr_t rc = _beginthreadex(NULL, 0, testTracepoints, (void*)t, 0, &threads[t]);
|
||||||
|
SLEEP(1); // debugger should for sure receive thread creation event after stepping over this sleep; not guaranteed to happen simply stepping over the thread creation call
|
||||||
|
if (rc == 0)
|
||||||
|
{
|
||||||
|
printf("ERROR; _beginthreadex() failed. errno = %d\n", errno);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
int rc = pthread_create(&threads[t], NULL, testTracepoints, (void *)t);
|
||||||
|
SLEEP(1); // debugger should for sure receive thread creation event after stepping over this sleep; not guaranteed to happen simply stepping over the thread creation call
|
||||||
|
if (rc)
|
||||||
|
{
|
||||||
|
printf("ERROR; return code from pthread_create() is %d\n", rc);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
SLEEP(2); // keep this thread around for a bit
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,9 @@ import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContex
|
||||||
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsUpdatedEvent;
|
import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointsUpdatedEvent;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
|
||||||
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
||||||
|
import org.eclipse.cdt.dsf.gdb.internal.tracepointactions.CollectAction;
|
||||||
|
import org.eclipse.cdt.dsf.gdb.internal.tracepointactions.EvaluateAction;
|
||||||
|
import org.eclipse.cdt.dsf.gdb.internal.tracepointactions.TracepointActionManager;
|
||||||
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData;
|
import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData;
|
||||||
import org.eclipse.cdt.dsf.mi.service.MIBreakpoints;
|
import org.eclipse.cdt.dsf.mi.service.MIBreakpoints;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
||||||
|
@ -58,6 +61,10 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
// GDB tracepoints are only supported on a remote target (e.g., using gdbserver)
|
// GDB tracepoints are only supported on a remote target (e.g., using gdbserver)
|
||||||
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
|
setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
|
||||||
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
|
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
|
||||||
|
|
||||||
|
// To test both fast and slow tracepoint we just the FAST_THEN_SLOW setting
|
||||||
|
setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
|
||||||
|
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_SLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
private DsfSession fSession;
|
private DsfSession fSession;
|
||||||
|
@ -69,56 +76,89 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
|
|
||||||
// private int fTotalTracingBufferSize = 0;
|
// private int fTotalTracingBufferSize = 0;
|
||||||
|
|
||||||
|
private static final String SOURCE_FILE = "TracepointTestApp.cc";
|
||||||
|
private static final String METHOD_NAME = "testTracepoints";
|
||||||
|
private static final int LINE_NUMBER_1 = 97;
|
||||||
|
private static final int LINE_NUMBER_2 = 75;
|
||||||
|
private static final int LINE_NUMBER_3 = 76;
|
||||||
|
private static final int LINE_NUMBER_4 = 85;
|
||||||
|
private static final int LINE_LOOP_2 = 109;
|
||||||
|
private static final String NO_CONDITION = "";
|
||||||
|
private static final String NO_COMMANDS = "";
|
||||||
|
// private static final int LAST_LINE_NUMBER = 94;
|
||||||
|
//
|
||||||
|
// private static final int TOTAL_FRAMES_TO_BE_COLLECTED = 1 + 1 + 10 + 1 + 10000;
|
||||||
|
|
||||||
private final static int[] PASS_COUNTS = {12, 2, 32, 6, 128, 0, 0, 0, 0, 0, 0, 0};
|
private final static int[] PASS_COUNTS = {12, 2, 32, 6, 128, 0, 0, 0, 0, 0, 0, 0};
|
||||||
|
private final static String[] CONDITIONS = {"gIntVar == 543", "gBoolVar == false", "counter == 3", "counter > 4", "counter > 2 && lIntVar == 12345"};
|
||||||
|
|
||||||
// private static CollectAction COLLECT_ACTION_1;
|
private static CollectAction[] COLLECT_ACTIONS = new CollectAction[10];
|
||||||
// private static CollectAction COLLECT_ACTION_2;
|
private static EvaluateAction[] EVAL_ACTIONS = new EvaluateAction[10];
|
||||||
// private static CollectAction COLLECT_ACTION_3;
|
// private static WhileSteppingAction[] STEPPING_ACTION_1 = new WhileSteppingAction[3];
|
||||||
// private static EvalAction EVAL_ACTION_1;
|
|
||||||
// private static EvalAction EVAL_ACTION_2;
|
|
||||||
// private static EvalAction EVAL_ACTION_3;
|
|
||||||
// private static WhileSteppingAction STEPPING_ACTION_1;
|
|
||||||
// private static WhileSteppingAction STEPPING_ACTION_2;
|
|
||||||
// private static WhileSteppingAction STEPPING_ACTION_3;
|
|
||||||
|
|
||||||
|
static {
|
||||||
|
TracepointActionManager tracepointActionMgr = TracepointActionManager.getInstance();
|
||||||
|
|
||||||
// static {
|
int index = 0;
|
||||||
// BreakpointActionManager breakpointActionMgr = CDebugCorePlugin.getDefault().getBreakpointActionManager();
|
COLLECT_ACTIONS[index] = new CollectAction();
|
||||||
//
|
COLLECT_ACTIONS[index].setCollectString("$locals");
|
||||||
// COLLECT_ACTION_1 = new CollectAction();
|
COLLECT_ACTIONS[index].setName("Collect locals");
|
||||||
// COLLECT_ACTION_1.setCollectString("$locals, counter");
|
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]);
|
||||||
// COLLECT_ACTION_1.setName("CollectAction1");
|
index++;
|
||||||
// breakpointActionMgr.addAction(COLLECT_ACTION_1);
|
|
||||||
//
|
COLLECT_ACTIONS[index] = new CollectAction();
|
||||||
// COLLECT_ACTION_2 = new CollectAction();
|
COLLECT_ACTIONS[index].setCollectString("gIntVar");
|
||||||
// COLLECT_ACTION_2.setCollectString("$reg");
|
COLLECT_ACTIONS[index].setName("Collect gIntVar");
|
||||||
// COLLECT_ACTION_2.setName("CollectAction2");
|
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]);
|
||||||
// breakpointActionMgr.addAction(COLLECT_ACTION_2);
|
index++;
|
||||||
//
|
|
||||||
// COLLECT_ACTION_3 = new CollectAction();
|
COLLECT_ACTIONS[index] = new CollectAction();
|
||||||
// COLLECT_ACTION_3.setCollectString("$myTraceVariable");
|
COLLECT_ACTIONS[index].setCollectString("$locals, counter, $reg");
|
||||||
// COLLECT_ACTION_3.setName("CollectAction3");
|
COLLECT_ACTIONS[index].setName("Collect locals, counter and reg");
|
||||||
// breakpointActionMgr.addAction(COLLECT_ACTION_3);
|
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]);
|
||||||
//
|
index++;
|
||||||
//
|
|
||||||
// EVAL_ACTION_1 = new EvalAction();
|
COLLECT_ACTIONS[index] = new CollectAction();
|
||||||
// EVAL_ACTION_1.setEvalString("$count=$count+1");
|
COLLECT_ACTIONS[index].setCollectString("$reg");
|
||||||
// EVAL_ACTION_1.setName("EvalAction1");
|
COLLECT_ACTIONS[index].setName("Collect reg");
|
||||||
// breakpointActionMgr.addAction(EVAL_ACTION_1);
|
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]);
|
||||||
//
|
index++;
|
||||||
// EVAL_ACTION_2 = new EvalAction();
|
|
||||||
// EVAL_ACTION_2.setEvalString("$count2=$count2+2");
|
COLLECT_ACTIONS[index] = new CollectAction();
|
||||||
// EVAL_ACTION_2.setName("EvalAction2");
|
COLLECT_ACTIONS[index].setCollectString("counter, $locals");
|
||||||
// breakpointActionMgr.addAction(EVAL_ACTION_2);
|
COLLECT_ACTIONS[index].setName("Collect counter, locals");
|
||||||
//
|
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]);
|
||||||
// EVAL_ACTION_3 = new EvalAction();
|
index++;
|
||||||
// EVAL_ACTION_3.setEvalString("$count3=$count3+3");
|
|
||||||
// EVAL_ACTION_3.setName("EvalAction3");
|
COLLECT_ACTIONS[index] = new CollectAction();
|
||||||
// breakpointActionMgr.addAction(EVAL_ACTION_3);
|
COLLECT_ACTIONS[index].setCollectString("$myTraceVariable");
|
||||||
//
|
COLLECT_ACTIONS[index].setName("Collect myTraceVariable");
|
||||||
// //TODO do while stepping actions
|
tracepointActionMgr.addAction(COLLECT_ACTIONS[index]);
|
||||||
//
|
index++;
|
||||||
// }
|
|
||||||
|
index=0;
|
||||||
|
EVAL_ACTIONS[index] = new EvaluateAction();
|
||||||
|
EVAL_ACTIONS[index].setEvalString("$count=$count+1");
|
||||||
|
EVAL_ACTIONS[index].setName("Eval increment count");
|
||||||
|
tracepointActionMgr.addAction(EVAL_ACTIONS[index]);
|
||||||
|
index++;
|
||||||
|
|
||||||
|
EVAL_ACTIONS[index] = new EvaluateAction();
|
||||||
|
EVAL_ACTIONS[index].setEvalString("$count2=$count2+2");
|
||||||
|
EVAL_ACTIONS[index].setName("Eval increment count2 by 2");
|
||||||
|
tracepointActionMgr.addAction(EVAL_ACTIONS[index]);
|
||||||
|
index++;
|
||||||
|
|
||||||
|
EVAL_ACTIONS[index] = new EvaluateAction();
|
||||||
|
EVAL_ACTIONS[index].setEvalString("$count3=$count3+3");
|
||||||
|
EVAL_ACTIONS[index].setName("Eval increment count3 by 3");
|
||||||
|
tracepointActionMgr.addAction(EVAL_ACTIONS[index]);
|
||||||
|
index++;
|
||||||
|
|
||||||
|
//TODO do while stepping actions
|
||||||
|
index=0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void initialTest() throws Exception {
|
public void initialTest() throws Exception {
|
||||||
|
@ -496,19 +536,6 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
// Below are the tests for the control of tracepoints.
|
// Below are the tests for the control of tracepoints.
|
||||||
// *********************************************************************
|
// *********************************************************************
|
||||||
|
|
||||||
private static final String SOURCE_FILE = "TracepointTestApp.cc";
|
|
||||||
private static final String METHOD_NAME = "testTracepoints";
|
|
||||||
private static final int LINE_NUMBER_1 = 84;
|
|
||||||
private static final int LINE_NUMBER_2 = 55;
|
|
||||||
private static final int LINE_NUMBER_3 = 56;
|
|
||||||
private static final int LINE_LOOP_1 = 81;
|
|
||||||
private static final int LINE_LOOP_2 = 88;
|
|
||||||
private static final String NO_CONDITION = "";
|
|
||||||
// private static final int LAST_LINE_NUMBER = 94;
|
|
||||||
//
|
|
||||||
// private static final int TOTAL_FRAMES_TO_BE_COLLECTED = 1 + 1 + 10 + 1 + 10000;
|
|
||||||
|
|
||||||
|
|
||||||
private IBreakpointDMContext[] fTracepoints = null;
|
private IBreakpointDMContext[] fTracepoints = null;
|
||||||
|
|
||||||
// private void checkTraceStatus(boolean supported, boolean active, int frames,
|
// private void checkTraceStatus(boolean supported, boolean active, int frames,
|
||||||
|
@ -548,7 +575,7 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
// checkTraceStatus(supported, active, frames, null, null);
|
// checkTraceStatus(supported, active, frames, null, null);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// GDB 7.0 does not support fast tracepoints, but GDB 7.1 will
|
// GDB 7.0 does not support fast tracepoints, but GDB 7.2 will
|
||||||
protected boolean fastTracepointsSupported() { return false; }
|
protected boolean fastTracepointsSupported() { return false; }
|
||||||
|
|
||||||
private class TracepointData {
|
private class TracepointData {
|
||||||
|
@ -557,16 +584,16 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
String condition;
|
String condition;
|
||||||
int passcount;
|
int passcount;
|
||||||
boolean enabled;
|
boolean enabled;
|
||||||
String actions;
|
String commands;
|
||||||
boolean isFastTp;
|
boolean isFastTp;
|
||||||
|
|
||||||
public TracepointData(String file, int line, String cond, int pass, boolean isEnabled, String acts, boolean fast) {
|
public TracepointData(String file, int line, String cond, int pass, boolean isEnabled, String cmds, boolean fast) {
|
||||||
sourceFile = file;
|
sourceFile = file;
|
||||||
lineNumber = line;
|
lineNumber = line;
|
||||||
condition = cond;
|
condition = cond;
|
||||||
passcount = pass;
|
passcount = pass;
|
||||||
enabled = isEnabled;
|
enabled = isEnabled;
|
||||||
actions = acts;
|
commands = cmds;
|
||||||
if (fastTracepointsSupported()) {
|
if (fastTracepointsSupported()) {
|
||||||
isFastTp = fast;
|
isFastTp = fast;
|
||||||
} else {
|
} else {
|
||||||
|
@ -600,10 +627,10 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
tp.getCondition().equals(data.condition));
|
tp.getCondition().equals(data.condition));
|
||||||
assertTrue("tracepoint "+i+" mismatch (wrong pass count) got " + tp.getPassCount(),
|
assertTrue("tracepoint "+i+" mismatch (wrong pass count) got " + tp.getPassCount(),
|
||||||
tp.getPassCount() == data.passcount);
|
tp.getPassCount() == data.passcount);
|
||||||
assertTrue("tracepoint "+i+" mismatch (wrong state) got " + tp.isEnabled(),
|
assertTrue("tracepoint "+i+" mismatch (wrong enablement) got " + tp.isEnabled(),
|
||||||
tp.isEnabled() == data.enabled);
|
tp.isEnabled() == data.enabled);
|
||||||
assertTrue("tracepoint mismatch (wrong actions) got " + tp.getCommands(),
|
assertTrue("tracepoint "+i+" mismatch (wrong actions) got " + tp.getCommands(),
|
||||||
tp.getCommands().equals(data.actions));
|
tp.getCommands().equals(data.commands));
|
||||||
|
|
||||||
assertTrue("tracepoint "+i+" mismatch",
|
assertTrue("tracepoint "+i+" mismatch",
|
||||||
tp.equals((MIBreakpointDMData)getBreakpoint(tracepoints[i])));
|
tp.equals((MIBreakpointDMData)getBreakpoint(tracepoints[i])));
|
||||||
|
@ -630,7 +657,7 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
* It also set a fast tracepoint by
|
* It also set a fast tracepoint by
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testCreateTracepoints() throws Throwable {
|
public void createTracepoints() throws Throwable {
|
||||||
|
|
||||||
Map<String, Object> attributes = null;
|
Map<String, Object> attributes = null;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
@ -648,7 +675,7 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
clearEventCounters();
|
clearEventCounters();
|
||||||
|
|
||||||
// Second tracepoint (will be a fast tracepoint)
|
// Second tracepoint (will be a slow tracepoint)
|
||||||
attributes = new HashMap<String, Object>();
|
attributes = new HashMap<String, Object>();
|
||||||
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
@ -662,11 +689,11 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
clearEventCounters();
|
clearEventCounters();
|
||||||
|
|
||||||
// Third tracepoint (will be a slow tracepoint)
|
// Third tracepoint (will be a fast tracepoint)
|
||||||
attributes = new HashMap<String, Object>();
|
attributes = new HashMap<String, Object>();
|
||||||
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_1);
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_4);
|
||||||
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
waitForBreakpointEvent();
|
waitForBreakpointEvent();
|
||||||
|
@ -705,11 +732,11 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
clearEventCounters();
|
clearEventCounters();
|
||||||
|
|
||||||
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, 0, true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, true, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, NO_COMMANDS, false));
|
||||||
|
|
||||||
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
}
|
}
|
||||||
|
@ -718,8 +745,8 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
* This test sets the different types of tracepoints and then deletes them
|
* This test sets the different types of tracepoints and then deletes them
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDeleteTracepoints() throws Throwable {
|
public void deleteTracepoints() throws Throwable {
|
||||||
testCreateTracepoints();
|
createTracepoints();
|
||||||
// Delete all tracepoints
|
// Delete all tracepoints
|
||||||
for (IBreakpointDMContext tp : fTracepoints) {
|
for (IBreakpointDMContext tp : fTracepoints) {
|
||||||
if (tp == null) break;
|
if (tp == null) break;
|
||||||
|
@ -736,8 +763,8 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
* This test sets the different types of tracepoints and then disables them
|
* This test sets the different types of tracepoints and then disables them
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testDisableTracepoints() throws Throwable {
|
public void disableTracepoints() throws Throwable {
|
||||||
testCreateTracepoints();
|
createTracepoints();
|
||||||
|
|
||||||
Map<String, Object> delta = new HashMap<String, Object>();
|
Map<String, Object> delta = new HashMap<String, Object>();
|
||||||
delta.put(MIBreakpoints.IS_ENABLED, false);
|
delta.put(MIBreakpoints.IS_ENABLED, false);
|
||||||
|
@ -748,11 +775,11 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, false, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, false, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, false, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, false, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, 0, false, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, false, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, false, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, false, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, false, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, false, NO_COMMANDS, false));
|
||||||
|
|
||||||
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
}
|
}
|
||||||
|
@ -761,8 +788,8 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
* This test sets, disables the different types of tracepoints and then enables them
|
* This test sets, disables the different types of tracepoints and then enables them
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testEnableTracepoints() throws Throwable {
|
public void enableTracepoints() throws Throwable {
|
||||||
testDisableTracepoints();
|
disableTracepoints();
|
||||||
|
|
||||||
Map<String, Object> delta = new HashMap<String, Object>();
|
Map<String, Object> delta = new HashMap<String, Object>();
|
||||||
delta.put(MIBreakpoints.IS_ENABLED, true);
|
delta.put(MIBreakpoints.IS_ENABLED, true);
|
||||||
|
@ -773,11 +800,11 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, 0, true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, true, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, NO_COMMANDS, false));
|
||||||
|
|
||||||
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
}
|
}
|
||||||
|
@ -786,8 +813,8 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
* This test sets the different types of tracepoints and then sets their passcount
|
* This test sets the different types of tracepoints and then sets their passcount
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testTracepointPasscount() throws Throwable {
|
public void tracepointPasscount() throws Throwable {
|
||||||
testCreateTracepoints();
|
createTracepoints();
|
||||||
|
|
||||||
Map<String, Object> delta = new HashMap<String, Object>();
|
Map<String, Object> delta = new HashMap<String, Object>();
|
||||||
// Set passcount for all tracepoints
|
// Set passcount for all tracepoints
|
||||||
|
@ -799,50 +826,408 @@ public class GDBRemoteTracepointsTest_7_0 extends BaseTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, PASS_COUNTS[0], true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, PASS_COUNTS[0], true, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, PASS_COUNTS[1], true, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, PASS_COUNTS[1], true, NO_COMMANDS, false));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_1, NO_CONDITION, PASS_COUNTS[2], true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, PASS_COUNTS[2], true, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, PASS_COUNTS[3], true, "", true));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, PASS_COUNTS[3], true, NO_COMMANDS, true));
|
||||||
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, PASS_COUNTS[4], true, "", false));
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, PASS_COUNTS[4], true, NO_COMMANDS, false));
|
||||||
|
|
||||||
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This test sets a tracepoint and then gives it a condition
|
* This test sets the different types of tracepoints and then sets some conditions
|
||||||
*/
|
*/
|
||||||
//@Test
|
@Test
|
||||||
public void testTracepointCondition() throws Throwable {
|
public void tracepointCondition() throws Throwable {
|
||||||
// Use trace state variables and stuff
|
createTracepoints();
|
||||||
|
|
||||||
|
Map<String, Object> delta = new HashMap<String, Object>();
|
||||||
|
// Set conditions for all tracepoints
|
||||||
|
for (int i=0; i<fTracepoints.length; i++) {
|
||||||
|
if (fTracepoints[i] == null) break;
|
||||||
|
if (CONDITIONS[i].equals(NO_CONDITION)) continue;
|
||||||
|
delta.put(MIBreakpoints.CONDITION, CONDITIONS[i]);
|
||||||
|
updateBreakpoint(fTracepoints[i], delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, CONDITIONS[0], 0, true, NO_COMMANDS, false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, CONDITIONS[1], 0, true, NO_COMMANDS, false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, CONDITIONS[2], 0, true, NO_COMMANDS, true));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[3], 0, true, NO_COMMANDS, true));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[4], 0, true, NO_COMMANDS, false));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test sets the different types of tracepoints and then sets some actions
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void tracepointActions() throws Throwable {
|
||||||
|
createTracepoints();
|
||||||
|
|
||||||
|
Map<String, Object> delta = new HashMap<String, Object>();
|
||||||
|
// Set conditions for all tracepoints
|
||||||
|
for (int i=0; i<fTracepoints.length; i++) {
|
||||||
|
if (fTracepoints[i] == null) break;
|
||||||
|
if (COLLECT_ACTIONS[i].equals(NO_COMMANDS)) continue;
|
||||||
|
delta.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[i].getName());
|
||||||
|
updateBreakpoint(fTracepoints[i], delta);
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_2, NO_CONDITION, 0, true, COLLECT_ACTIONS[0].toString(), false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_3, NO_CONDITION, 0, true, COLLECT_ACTIONS[1].toString(), false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_4, NO_CONDITION, 0, true, COLLECT_ACTIONS[2].toString(), true));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, COLLECT_ACTIONS[3].toString(), true));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, COLLECT_ACTIONS[4].toString(), false));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test creates a tracepoint that starts disabled
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void createTracepointDisabled() throws Throwable {
|
||||||
|
Map<String, Object> attributes = null;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
// First tracepoint will be a slow tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2);
|
||||||
|
attributes.put(MIBreakpoints.IS_ENABLED, false);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
// Second tracepoint will be a fast tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1);
|
||||||
|
attributes.put(MIBreakpoints.IS_ENABLED, false);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, false, NO_COMMANDS, false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, false, NO_COMMANDS, true));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test creates a tracepoint that starts with a passcount
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void createTracepointWithPasscount() throws Throwable {
|
||||||
|
Map<String, Object> attributes = null;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
// First tracepoint will be a slow tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2);
|
||||||
|
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[0]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
// Second tracepoint will be a fast tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1);
|
||||||
|
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[1]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, PASS_COUNTS[0], true, NO_COMMANDS, false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, PASS_COUNTS[1], true, NO_COMMANDS, true));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test creates a tracepoint that starts with a condition
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void createTracepointWithCondition() throws Throwable {
|
||||||
|
Map<String, Object> attributes = null;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
// First tracepoint will be a slow tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2);
|
||||||
|
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[0]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
// Second tracepoint will be a fast tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1);
|
||||||
|
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[1]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[0], 0, true, NO_COMMANDS, false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[1], 0, true, NO_COMMANDS, true));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test creates tracepoints that start a command
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void createTracepointWithCommand() throws Throwable {
|
||||||
|
Map<String, Object> attributes = null;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
// First tracepoint will be a slow tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2);
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[0].getName());
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
// Second tracepoint will be a fast tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1);
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[1].getName());
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, COLLECT_ACTIONS[0].toString(), false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, COLLECT_ACTIONS[1].toString(), true));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test creates tracepoints that start with more than one command
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void createTracepointWithMultipleCommands() throws Throwable {
|
||||||
|
Map<String, Object> attributes = null;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
// First tracepoint will be a slow tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2);
|
||||||
|
String commandsNames1 = COLLECT_ACTIONS[0].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[1].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[2].getName();
|
||||||
|
String commandsResult1 = COLLECT_ACTIONS[0].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[1].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[2].toString();
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, commandsNames1);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
// Second tracepoint will be a fast tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1);
|
||||||
|
String commandsNames2 = COLLECT_ACTIONS[2].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[2].getName() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[1].getName();
|
||||||
|
String commandsResult2 = COLLECT_ACTIONS[2].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[2].toString() + TracepointActionManager.TRACEPOINT_ACTION_DELIMITER +
|
||||||
|
COLLECT_ACTIONS[1].toString();
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, commandsNames2);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, NO_CONDITION, 0, true, commandsResult1, false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, commandsResult2, true));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test creates an enabled tracepoint that starts with commands, condition and passcount
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void createTracepointEnabledWithCommandsConditionPasscount() throws Throwable {
|
||||||
|
Map<String, Object> attributes = null;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
// First tracepoint will be a slow tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2);
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[0].getName());
|
||||||
|
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[0]);
|
||||||
|
attributes.put(MIBreakpoints.IS_ENABLED, true);
|
||||||
|
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[0]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
// Second tracepoint will be a fast tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1);
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[1].getName());
|
||||||
|
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[1]);
|
||||||
|
attributes.put(MIBreakpoints.IS_ENABLED, true);
|
||||||
|
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[1]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[0], PASS_COUNTS[0], true, COLLECT_ACTIONS[0].toString(), false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[1], PASS_COUNTS[1], true, COLLECT_ACTIONS[1].toString(), true));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This test creates a disabled tracepoint that starts with commands, condition and passcount
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void createTracepointDisabledWithCommandsConditionPasscount() throws Throwable {
|
||||||
|
Map<String, Object> attributes = null;
|
||||||
|
int index = 0;
|
||||||
|
|
||||||
|
// First tracepoint will be a slow tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_LOOP_2);
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[0].getName());
|
||||||
|
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[0]);
|
||||||
|
attributes.put(MIBreakpoints.IS_ENABLED, false);
|
||||||
|
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[0]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
// Second tracepoint will be a fast tracepoint
|
||||||
|
attributes = new HashMap<String, Object>();
|
||||||
|
attributes.put(MIBreakpoints.BREAKPOINT_TYPE, MIBreakpoints.TRACEPOINT);
|
||||||
|
attributes.put(MIBreakpoints.FILE_NAME, SOURCE_FILE);
|
||||||
|
attributes.put(MIBreakpoints.LINE_NUMBER, LINE_NUMBER_1);
|
||||||
|
attributes.put(MIBreakpoints.COMMANDS, COLLECT_ACTIONS[1].getName());
|
||||||
|
attributes.put(MIBreakpoints.CONDITION, CONDITIONS[1]);
|
||||||
|
attributes.put(MIBreakpoints.IS_ENABLED, false);
|
||||||
|
attributes.put(MIBreakpoints.PASS_COUNT, PASS_COUNTS[1]);
|
||||||
|
fTracepoints[index++] = insertBreakpoint(fBreakpointsDmc, attributes);
|
||||||
|
|
||||||
|
waitForBreakpointEvent();
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
|
||||||
|
+ fBreakpointEventCount, fBreakpointEventCount == 1);
|
||||||
|
assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT_ADDED event(s), received "
|
||||||
|
+ getBreakpointEventCount(BP_ADDED), getBreakpointEventCount(BP_ADDED) == 1);
|
||||||
|
clearEventCounters();
|
||||||
|
|
||||||
|
ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_LOOP_2, CONDITIONS[0], PASS_COUNTS[0], false, COLLECT_ACTIONS[0].toString(), false));
|
||||||
|
dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, CONDITIONS[1], PASS_COUNTS[1], false, COLLECT_ACTIONS[1].toString(), true));
|
||||||
|
|
||||||
|
checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
||||||
|
}
|
||||||
|
|
||||||
// private void testActions(String[] actions) throws Throwable {
|
|
||||||
// Map<String, Object> delta = new HashMap<String, Object>();
|
|
||||||
// ArrayList<TracepointData> dataArray = new ArrayList<TracepointData>();
|
|
||||||
//
|
|
||||||
// for (int i=0; i<actions.length; i++) {
|
|
||||||
// delta.put(MIBreakpoints.COMMANDS, actions[i]);
|
|
||||||
// updateBreakpoint(fTracepoints[i], delta);
|
|
||||||
// dataArray.add(new TracepointData(SOURCE_FILE, LINE_NUMBER_1, NO_CONDITION, 0, true, actions[i], false));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// checkTracepoints(dataArray.toArray(new TracepointData[dataArray.size()]));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * This test sets the different types of tracepoints and then sets some collect actions
|
|
||||||
// */
|
|
||||||
// @Test
|
|
||||||
// public void testCollectActions() throws Throwable {
|
|
||||||
// final String ACTIONS1 = COLLECT_ACTION_1.getName()+","+COLLECT_ACTION_2.getName()+","+COLLECT_ACTION_3.getName();
|
|
||||||
// final String ACTIONS2 = COLLECT_ACTION_1.getName()+","+COLLECT_ACTION_3.getName();
|
|
||||||
// final String ACTIONS3 = COLLECT_ACTION_3.getName();
|
|
||||||
//
|
|
||||||
// testCreateTracepoints();
|
|
||||||
// testActions(new String[] {ACTIONS1, ACTIONS2, ACTIONS3, ""});
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// /**
|
// /**
|
||||||
// * This test sets the different types of tracepoints and then sets some eval actions
|
// * This test sets the different types of tracepoints and then sets some eval actions
|
||||||
// */
|
// */
|
||||||
|
|
|
@ -23,4 +23,7 @@ public class GDBRemoteTracepointsTest_7_2 extends GDBRemoteTracepointsTest_7_1 {
|
||||||
public static void beforeClassMethod_7_2() {
|
public static void beforeClassMethod_7_2() {
|
||||||
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_2);
|
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean fastTracepointsSupported() { return true; }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue