Skip to content

Commit 5022423

Browse files
authored
[projmgr] Ensure AC6 special load handling when user explicit specifies image+symbols
1 parent c5bb9ae commit 5022423

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ void ProjMgrRunDebug::AddGeneratedImage(const ContextItem* context, const string
540540
image.file = file;
541541
image.info = "generate by " + context->name;
542542
image.type = type;
543-
image.load = type == RteConstants::OUTPUT_TYPE_ELF && !context->elfLoadMode.empty() ? context->elfLoadMode : load;
543+
image.load = load;
544544
image.pname = context->deviceItem.pname;
545545
image.offset = type == RteConstants::OUTPUT_TYPE_BIN ? context->loadOffset : RteUtils::EMPTY_STRING;
546546
m_runDebug.outputs.push_back(image);
@@ -553,17 +553,20 @@ void ProjMgrRunDebug::AddGeneratedImages(const ContextItem* context) {
553553
- When only a file with 'type: elf' is generated, the file gets 'load: image+symbols'
554554
- When a file with 'type: elf' and a file with 'type: hex' is generated, the 'type: elf' file gets 'load: symbols' and the 'type: hex' file gets 'load: image'
555555
- All other file types get 'load: none'
556+
- This work-around should be still intact when load: image+symbols is explicitly stated
556557
For any other compiler:
557558
- Files with 'type: elf' get 'load: image+symbols'
558559
- All other file types get 'load: none'
559560
*/
561+
const auto elfLoadMode = !context->elfLoadMode.empty() ? context->elfLoadMode : LOAD_IMAGE_SYMBOLS;
562+
const bool enableAC6Handling = context->compiler == "AC6" && context->outputTypes.hex.on && elfLoadMode == LOAD_IMAGE_SYMBOLS;
560563
if (context->outputTypes.elf.on) {
561564
AddGeneratedImage(context, context->outputTypes.elf.filename, RteConstants::OUTPUT_TYPE_ELF,
562-
context->compiler == "AC6" && context->outputTypes.hex.on ? LOAD_SYMBOLS : LOAD_IMAGE_SYMBOLS);
565+
enableAC6Handling ? LOAD_SYMBOLS : elfLoadMode);
563566
}
564567
if (context->outputTypes.hex.on) {
565568
AddGeneratedImage(context, context->outputTypes.hex.filename, RteConstants::OUTPUT_TYPE_HEX,
566-
context->compiler == "AC6" ? LOAD_IMAGE : LOAD_NONE);
569+
enableAC6Handling ? LOAD_IMAGE : LOAD_NONE);
567570
}
568571
if (context->outputTypes.bin.on) {
569572
AddGeneratedImage(context, context->outputTypes.bin.filename, RteConstants::OUTPUT_TYPE_BIN, LOAD_NONE);

tools/projmgr/test/data/TestRunDebug/run-debug.csolution.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ solution:
4646
- project-context: core0
4747
load: none
4848
- project-context: core1
49-
load: symbols
49+
load: image+symbols
5050
debugger:
5151
name: CMSIS-DAP
5252
start-pname: cm0_core1

0 commit comments

Comments
 (0)