Skip to content

Commit adc6a1e

Browse files
prefer gdbinit prefix_map with fallback to prefix_map_gdbinit (#1660)
1 parent 95f78ec commit adc6a1e

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

src/cdtDebugAdapter/debugConfProvider.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,23 @@ export class CDTDebugConfigurationProvider
8989
);
9090
if (isAppReproducibleBuildEnabled === "y") {
9191
const buildDirPath = readParameter("idf.buildPath", folder) as string;
92-
config.initCommands.push(
93-
`source ${join(buildDirPath, "prefix_map_gdbinit")}`
94-
);
92+
const gdbinitPrefixMap = join(buildDirPath, "gdbinit", "prefix_map");
93+
const gdbinitPrefixMapExists = await pathExists(gdbinitPrefixMap);
94+
if (gdbinitPrefixMapExists) {
95+
config.initCommands.push(`source ${gdbinitPrefixMap}`);
96+
} else {
97+
const prefix_map_gdbinit = join(buildDirPath, "prefix_map_gdbinit");
98+
const prefix_map_gdbinitExists = await pathExists(
99+
prefix_map_gdbinit
100+
);
101+
if (prefix_map_gdbinitExists) {
102+
config.initCommands.push(`source ${prefix_map_gdbinit}`);
103+
} else {
104+
window.showInformationMessage(
105+
`CONFIG_APP_REPRODUCIBLE_BUILD is enabled but no gdbinit prefix map was found.`
106+
);
107+
}
108+
}
95109
}
96110
if (typeof config.initialBreakpoint === "undefined") {
97111
config.initCommands.push(`thb app_main`);

0 commit comments

Comments
 (0)