mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-01 06:05:24 +02:00
Bug 458499 - Unable to debug when GDB command contains additional
arguments Change-Id: I0cfb07dd04d28062a653f76dbd23510d712e4c71 Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
parent
b662f3b063
commit
624446b2c3
2 changed files with 21 additions and 12 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2010, 2014 Ericsson and others.
|
* Copyright (c) 2010, 2015 Ericsson and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -46,6 +46,7 @@ import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
|
||||||
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
|
import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
|
||||||
import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
import org.eclipse.cdt.dsf.gdb.service.SessionType;
|
||||||
|
import org.eclipse.cdt.utils.CommandLineUtil;
|
||||||
import org.eclipse.cdt.utils.spawner.ProcessFactory;
|
import org.eclipse.cdt.utils.spawner.ProcessFactory;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
@ -299,8 +300,11 @@ public class LaunchUtils {
|
||||||
* A timeout is scheduled which will kill the process if it takes too long.
|
* A timeout is scheduled which will kill the process if it takes too long.
|
||||||
*/
|
*/
|
||||||
public static String getGDBVersion(final ILaunchConfiguration configuration) throws CoreException {
|
public static String getGDBVersion(final ILaunchConfiguration configuration) throws CoreException {
|
||||||
String cmd = getGDBPath(configuration).toOSString();
|
String cmd = getGDBPath(configuration).toOSString() + " --version"; //$NON-NLS-1$
|
||||||
String[] args = new String[] { cmd, "--version" }; //$NON-NLS-1$
|
|
||||||
|
// Parse cmd to properly handle spaces and such things (bug 458499)
|
||||||
|
String[] args = CommandLineUtil.argumentsToArray(cmd);
|
||||||
|
|
||||||
Process process = null;
|
Process process = null;
|
||||||
Job timeoutJob = null;
|
Job timeoutJob = null;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2012 Wind River Systems, Nokia and others.
|
* Copyright (c) 2006, 2015 Wind River Systems, Nokia and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -47,6 +47,7 @@ import org.eclipse.cdt.dsf.mi.service.command.events.MIStoppedEvent;
|
||||||
import org.eclipse.cdt.dsf.service.AbstractDsfService;
|
import org.eclipse.cdt.dsf.service.AbstractDsfService;
|
||||||
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
import org.eclipse.cdt.dsf.service.DsfServiceEventHandler;
|
||||||
import org.eclipse.cdt.dsf.service.DsfSession;
|
import org.eclipse.cdt.dsf.service.DsfSession;
|
||||||
|
import org.eclipse.cdt.utils.CommandLineUtil;
|
||||||
import org.eclipse.cdt.utils.spawner.ProcessFactory;
|
import org.eclipse.cdt.utils.spawner.ProcessFactory;
|
||||||
import org.eclipse.cdt.utils.spawner.Spawner;
|
import org.eclipse.cdt.utils.spawner.Spawner;
|
||||||
import org.eclipse.core.resources.IContainer;
|
import org.eclipse.core.resources.IContainer;
|
||||||
|
@ -203,14 +204,18 @@ public class GDBBackend extends AbstractDsfService implements IGDBBackend, IMIBa
|
||||||
// The goal here is to keep options to an absolute minimum.
|
// The goal here is to keep options to an absolute minimum.
|
||||||
// All configuration should be done in the final launch sequence
|
// All configuration should be done in the final launch sequence
|
||||||
// to allow for more flexibility.
|
// to allow for more flexibility.
|
||||||
return new String[] { getGDBPath().toOSString(), // This could contain spaces
|
|
||||||
"--interpreter", //$NON-NLS-1$
|
String cmd = getGDBPath().toOSString() +
|
||||||
// We currently work with MI version 2. Don't use just 'mi' because it
|
" --interpreter" + //$NON-NLS-1$
|
||||||
// points to the latest MI version, while we want mi2 specifically.
|
// We currently work with MI version 2. Don't use just 'mi' because it
|
||||||
"mi2", //$NON-NLS-1$
|
// points to the latest MI version, while we want mi2 specifically.
|
||||||
// Don't read the gdbinit file here. It is read explicitly in
|
" mi2" + //$NON-NLS-1$
|
||||||
// the LaunchSequence to make it easier to customize.
|
// Don't read the gdbinit file here. It is read explicitly in
|
||||||
"--nx" }; //$NON-NLS-1$
|
// the LaunchSequence to make it easier to customize.
|
||||||
|
" --nx"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
// Parse to properly handle spaces and such things (bug 458499)
|
||||||
|
return CommandLineUtil.argumentsToArray(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue