diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBServiceFactory.java b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBServiceFactory.java index 8f3b60681e3..fe085d83390 100644 --- a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBServiceFactory.java +++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/LLDBServiceFactory.java @@ -13,8 +13,8 @@ import org.eclipse.cdt.dsf.debug.service.IProcesses; import org.eclipse.cdt.dsf.debug.service.IRunControl; import org.eclipse.cdt.dsf.debug.service.command.ICommandControl; import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory; -import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; import org.eclipse.cdt.dsf.service.DsfSession; +import org.eclipse.cdt.llvm.dsf.lldb.core.internal.service.commands.LLDBCommandFactory; import org.eclipse.debug.core.ILaunchConfiguration; /** @@ -36,7 +36,7 @@ public class LLDBServiceFactory extends GdbDebugServicesFactory { @Override protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) { - return new LLDBControl(session, config, new CommandFactory()); + return new LLDBControl(session, config, new LLDBCommandFactory()); } @Override diff --git a/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/commands/LLDBCommandFactory.java b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/commands/LLDBCommandFactory.java new file mode 100644 index 00000000000..b04423a81dc --- /dev/null +++ b/llvm/org.eclipse.cdt.llvm.dsf.lldb.core/src/org/eclipse/cdt/llvm/dsf/lldb/core/internal/service/commands/LLDBCommandFactory.java @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2018 Marc-Andre Laperle. + * 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 + *******************************************************************************/ + +package org.eclipse.cdt.llvm.dsf.lldb.core.internal.service.commands; + +import org.eclipse.cdt.dsf.debug.service.command.ICommand; +import org.eclipse.cdt.dsf.mi.service.IMIContainerDMContext; +import org.eclipse.cdt.dsf.mi.service.command.CommandFactory; +import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo; + +/** + * A command factory specific to LLDB for cases where some commands need any + * kind of tweaks to account for discrepancies with GDB. + */ +public class LLDBCommandFactory extends CommandFactory { + + /** + * lldb-mi (as of 8.0.0-r341271) doesn't implement "-gdb-set args" but it does + * implement "-exec-arguments". So we just substitute here. + * See also https://bugs.llvm.org/show_bug.cgi?id=38834 + */ + @Override + public ICommand createMIGDBSetArgs(IMIContainerDMContext dmc) { + return super.createMIExecArguments(dmc, new String[0]); + } + + /** + * @see #createMIGDBSetArgs(IMIContainerDMContext) + */ + @Override + public ICommand createMIGDBSetArgs(IMIContainerDMContext dmc, String[] arguments) { + return super.createMIExecArguments(dmc, arguments); + } +}