From e1d34d2d31b942d971b228dc2eb29940886ac2c0 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Thu, 2 Sep 2010 12:34:31 +0000 Subject: [PATCH] Bug 248595: Use the "set breakpoint pending on" command to make breakpoints/tracepoints set in the gdb console, or using a CLI command, still be pending if needed. --- .../gdb/launching/FinalLaunchSequence.java | 17 ++++++++++ .../mi/service/command/CommandFactory.java | 6 ++++ .../commands/MIGDBSetBreakpointPending.java | 32 +++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetBreakpointPending.java diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java index df43b455dcb..aee4ba769d1 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence.java @@ -75,6 +75,7 @@ public class FinalLaunchSequence extends ReflectionSequence { return new String[] { "stepInitializeFinalLaunchSequence", //$NON-NLS-1$ "stepSetEnvironmentDirectory", //$NON-NLS-1$ + "stepSetBreakpointPending", //$NON-NLS-1$ "stepSourceGDBInitFile", //$NON-NLS-1$ "stepSetEnvironmentVariables", //$NON-NLS-1$ "stepSetExecutable", //$NON-NLS-1$ @@ -163,6 +164,22 @@ public class FinalLaunchSequence extends ReflectionSequence { requestMonitor.done(); } } + + /** + * Allow breakpoints/tracepoints to be set as pending when using the gdb console + * or a CLI command to create them. + * @since 4.0 + */ + @Execute + public void stepSetBreakpointPending(final RequestMonitor requestMonitor) { + if (fSessionType != SessionType.CORE) { + fCommandControl.queueCommand( + fCommandFactory.createMIGDBSetBreakpointPending(fCommandControl.getContext(), true), + new DataRequestMonitor(getExecutor(), requestMonitor)); + } else { + requestMonitor.done(); + } + } /** * Source the gdbinit file specified in the launch. diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java index 942195a4bb4..aca7b0f37a8 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java @@ -86,6 +86,7 @@ import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBExit; import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSet; import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetArgs; import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetAutoSolib; +import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetBreakpointPending; import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetEnv; import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetNonStop; import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetPagination; @@ -554,6 +555,11 @@ public class CommandFactory { return new MIGDBSetAutoSolib(ctx, isSet); } + /** @since 4.0 */ + public ICommand createMIGDBSetBreakpointPending(ICommandControlDMContext ctx, boolean enable) { + return new MIGDBSetBreakpointPending(ctx, enable); + } + public ICommand createMIGDBSetEnv(ICommandControlDMContext dmc, String name) { return new MIGDBSetEnv(dmc, name); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetBreakpointPending.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetBreakpointPending.java new file mode 100644 index 00000000000..7c9dcd6ddda --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/commands/MIGDBSetBreakpointPending.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2010 Ericsson 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: + * Ericsson - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.dsf.mi.service.command.commands; + +import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext; + +/** + * + * -gdb-set breakpoint pending [on | off] + * + * This command should be used to make breakpoints/tracepoints that are created + * using a CLI command to be set as potentially pending breakpoints in GDB. + * + * Available with GDB 6.1 + * + * @since 4.0 + * + */ +public class MIGDBSetBreakpointPending extends MIGDBSet +{ + public MIGDBSetBreakpointPending(ICommandControlDMContext ctx, boolean enable) { + super(ctx, new String[] {"breakpoint", "pending", enable ? "on" : "off"});//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ + } +} \ No newline at end of file