From 53ffcc1f69987d3a7139ba72632979176721a3c5 Mon Sep 17 00:00:00 2001 From: sitieqiang Date: Fri, 13 Feb 2026 14:48:43 +0800 Subject: [PATCH] file cmd is must. GDB symbols must be configured; otherwise, multi-architecture GDB will be unable to obtain the target's architecture information, resulting in a connection failure.... --- src/gdb.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gdb.ts b/src/gdb.ts index 344d633e..987b1b9d 100755 --- a/src/gdb.ts +++ b/src/gdb.ts @@ -1069,7 +1069,6 @@ export class GDBDebugSession extends LoggingDebugSession { ]; const loadFiles = this.args.loadFiles; - let isLoaded = false; if (this.args.symbolFiles) { // If you just used 'add-symbol-file' debugging works but RTOS detection fails // for most debuggers. @@ -1087,12 +1086,11 @@ export class GDBDebugSession extends LoggingDebugSession { } this.gdbInitCommands.push(...this.symInitCommands); this.symInitCommands = []; - } else if (!loadFiles && this.args.executable) { + } else if (this.args.executable) { this.gdbInitCommands.push(`file-exec-and-symbols "${this.args.executable}"`); - isLoaded = true; } - if (!isLoaded && !loadFiles && this.args.executable) { + if (!loadFiles && this.args.executable) { this.args.loadFiles = [this.args.executable]; } const ret = this.miDebugger.start(this.args.cwd, this.gdbInitCommands);