Skip to content

Commit 5f789a4

Browse files
committed
fix built-in gdb path and resolve only once
Signed-off-by: Jens Reinecke <jens.reinecke@arm.com>
1 parent ec33509 commit 5f789a4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/debug-configuration/gdbtarget-configuration-provider.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { BuiltinToolPath } from '../desktop/builtin-tool-path';
2727

2828
const GDB_TARGET_DEBUGGER_TYPE = 'gdbtarget';
2929
const ARM_NONE_EABI_GDB_NAME = 'arm-none-eabi-gdb';
30-
const ARM_NONE_EABI_GDB_BUILTIN_PATH = 'tools/gdb/arm-none-eabi-gdb';
30+
const ARM_NONE_EABI_GDB_BUILTIN_PATH = 'tools/gdb/bin/arm-none-eabi-gdb';
3131
const ARM_NONE_EABI_GDB_EXECUTABLE_ONLY_REGEXP = /^\s*arm-none-eabi-gdb(|.exe)\s*$/i;
3232

3333
export interface GDBTargetConfigurationSubProvider {
@@ -106,9 +106,7 @@ export class GDBTargetConfigurationProvider implements vscode.DebugConfiguration
106106
token?: vscode.CancellationToken
107107
): Promise<vscode.DebugConfiguration | null | undefined> {
108108
this.logDebugConfiguration(resolverType, debugConfiguration, 'original config');
109-
logger.debug(`${resolverType}: Resolve GDB path`);
110109
const gdbTargetConfig: GDBTargetConfiguration = debugConfiguration;
111-
this.resolveGdbPath(gdbTargetConfig);
112110
const gdbServerType = gdbTargetConfig.target?.server;
113111
const subprovider = this.getRelevantSubprovider(resolverType, gdbServerType);
114112
if (!subprovider) {
@@ -139,6 +137,9 @@ export class GDBTargetConfigurationProvider implements vscode.DebugConfiguration
139137
debugConfiguration: vscode.DebugConfiguration,
140138
token?: vscode.CancellationToken
141139
): Promise<vscode.DebugConfiguration | null | undefined> {
140+
// Only resolve GDB path once, otherwise regexp check will fail
141+
logger.debug('resolveDebugConfigurationWithSubstitutedVariables: Resolve GDB path');
142+
this.resolveGdbPath(debugConfiguration);
142143
return this.resolveDebugConfigurationByResolverType('resolveDebugConfigurationWithSubstitutedVariables', folder, debugConfiguration, token);
143144
}
144145

0 commit comments

Comments
 (0)