From c42f98e33308f2881e9291f5ef9b8c42e41ac30d Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Tue, 3 Jan 2012 16:01:59 -0500 Subject: [PATCH] Bug 367788: maint set python print-stack has been removed from GDB 7.4 --- .../gdb/service/GdbDebugServicesFactory.java | 13 ++++++- .../gdb/service/command/GDBControl_7_4.java | 39 +++++++++++++++++++ 2 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_4.java diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java index 8af2b962ee4..5eaccda0f6e 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/GdbDebugServicesFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Ericsson and others. + * Copyright (c) 2008, 2012 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 @@ -9,6 +9,7 @@ * Ericsson - initial API and implementation * Nokia - create and use backend service. * Onur Akdemir (TUBITAK BILGEM-ITI) - Multi-process debugging (Bug 237306) + * Marc Khouzam (Ericsson) - Support for GDB 7.4 (Bug 367788) *******************************************************************************/ package org.eclipse.cdt.dsf.gdb.service; @@ -29,6 +30,7 @@ import org.eclipse.cdt.dsf.gdb.service.command.CommandFactory_6_8; import org.eclipse.cdt.dsf.gdb.service.command.GDBControl; import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_0; import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_2; +import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_4; import org.eclipse.cdt.dsf.mi.service.CSourceLookup; import org.eclipse.cdt.dsf.mi.service.IMIBackend; import org.eclipse.cdt.dsf.mi.service.MIBreakpoints; @@ -55,7 +57,11 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory { public static final String GDB_7_2_VERSION = "7.2"; //$NON-NLS-1$ /** @since 4.1 */ public static final String GDB_7_2_1_VERSION = "7.2.1"; //$NON-NLS-1$ - + + // Keep private until GDB 7.4 is released and we can change the constant + // to its proper value of 7.4 + private static final String GDB_7_4_VERSION = "7.3.50"; //$NON-NLS-1$ + private final String fVersion; public GdbDebugServicesFactory(String version) { @@ -112,6 +118,9 @@ public class GdbDebugServicesFactory extends AbstractDsfDebugServicesFactory { } protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) { + if (GDB_7_4_VERSION.compareTo(fVersion) <= 0) { + return new GDBControl_7_4(session, config, new CommandFactory_6_8()); + } if (GDB_7_2_VERSION.compareTo(fVersion) <= 0) { return new GDBControl_7_2(session, config, new CommandFactory_6_8()); } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_4.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_4.java new file mode 100644 index 00000000000..16fcb5317fd --- /dev/null +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/service/command/GDBControl_7_4.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2012 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: + * Marc Khouzam (Ericsson) - initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.dsf.gdb.service.command; + +import org.eclipse.cdt.dsf.concurrent.RequestMonitor; +import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; +import org.eclipse.cdt.dsf.service.DsfSession; +import org.eclipse.debug.core.ILaunchConfiguration; + +/** + * With GDB 7.4, the command 'maintenance set python print-stack' is not supported. + * The new command "set python print-stack none|full|message" has replaced it, with + * the default being 'message'. With this new default + * @since 4.1 + */ +public class GDBControl_7_4 extends GDBControl_7_2 implements IGDBControl { + public GDBControl_7_4(DsfSession session, ILaunchConfiguration config, CommandFactory factory) { + super(session, config, factory); + setUseThreadGroupOptions(true); + } + + @Override + public void setPrintPythonErrors(boolean enabled, RequestMonitor rm) { + // With GDB 7.4, the command 'maintenance set python print-stack' is not supported. + // The new command "set python print-stack none|full|message" has replaced it, with + // the default being 'message'. This new default is good enough for us, so no + // need to do anything anymore. + // Bug 367788 + rm.done(); + } +}