Skip to content

Commit 1d73f11

Browse files
committed
Use mi-async instead of target-async on GDB >= 7.12
target-async is the old name for mi-async. mi-async came into existence in GDB 7.8, but in later releases it becomes a warning to use the old name. Because we already have the version infra for 7.12 we change to using mi-async from 7.12 A similar change was made for [cdt-gdb-adapter a while ago](https://github.com/eclipse-cdt-cloud/cdt-gdb-adapter/blob/main/src/GDBBackend.ts#L114-L116) Fixes #176
1 parent 1b19ba2 commit 1d73f11

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/launching/FinalLaunchSequence_7_12.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public void stepSetTargetAsync(RequestMonitor requestMonitor) {
115115
asyncOn = true;
116116
}
117117

118-
fCommandControl.queueCommand(fCommandFactory.createMIGDBSetTargetAsync(fCommandControl.getContext(), asyncOn),
118+
fCommandControl.queueCommand(fCommandFactory.createMIGDBSetMIAsync(fCommandControl.getContext(), asyncOn),
119119
new DataRequestMonitor<MIInfo>(getExecutor(), requestMonitor) {
120120
@Override
121121
protected void handleError() {

dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CommandFactory.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetEnv;
136136
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetHostCharset;
137137
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetLanguage;
138+
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetMIAsync;
138139
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetNewConsole;
139140
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetNonStop;
140141
import org.eclipse.cdt.dsf.mi.service.command.commands.MIGDBSetPagination;
@@ -895,6 +896,11 @@ public ICommand<MIInfo> createMIGDBSetTargetAsync(ICommandControlDMContext ctx,
895896
return new MIGDBSetTargetAsync(ctx, isSet);
896897
}
897898

899+
/** @since 7.0 */
900+
public ICommand<MIInfo> createMIGDBSetMIAsync(ICommandControlDMContext ctx, boolean isSet) {
901+
return new MIGDBSetMIAsync(ctx, isSet);
902+
}
903+
898904
/** @since 4.4 */
899905
public ICommand<MIInfo> createMIGDBSetTraceNotes(ITraceTargetDMContext ctx, String notes) {
900906
return new MIGDBSetTraceNotes(ctx, notes);
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2009, 2022 Ericsson and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* Ericsson - Initial API and implementation
13+
*******************************************************************************/
14+
package org.eclipse.cdt.dsf.mi.service.command.commands;
15+
16+
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
17+
18+
/**
19+
*
20+
* -gdb-set mi-async [on | off]
21+
*
22+
* @since 7.0
23+
*/
24+
public class MIGDBSetMIAsync extends MIGDBSet {
25+
public MIGDBSetMIAsync(ICommandControlDMContext ctx, boolean isSet) {
26+
super(ctx, new String[] { "mi-async", isSet ? "on" : "off" });//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
27+
}
28+
}

jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void stepSetTargetAsync(RequestMonitor rm) {
6565
// Use target async when interfacing with the full GDB console (i.e. minimum GDB version 7.12)
6666
// otherwise explicitly set it to off.
6767
commandControl.queueCommand(commandControl.getCommandFactory()
68-
.createMIGDBSetTargetAsync(commandControl.getContext(), gdbBackEnd.useTargetAsync()),
68+
.createMIGDBSetMIAsync(commandControl.getContext(), gdbBackEnd.useTargetAsync()),
6969
new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
7070
@Override
7171
protected void handleError() {

0 commit comments

Comments
 (0)