Skip to content

Commit b4e6c4a

Browse files
authored
[projmgr] Handle project-context load exclusively for generated elf type
1 parent f47f81a commit b4e6c4a

File tree

7 files changed

+14
-14
lines changed

7 files changed

+14
-14
lines changed

tools/projmgr/include/ProjMgrWorker.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ struct DebuggerType {
425425
* images
426426
* selected target-set
427427
* load offset for generated binary
428-
* load modes
428+
* elf load mode
429429
* image only flag
430430
*/
431431
struct ContextItem {
@@ -494,7 +494,7 @@ struct ContextItem {
494494
std::vector<ImageItem> images;
495495
std::string targetSet;
496496
std::string loadOffset;
497-
StrMap loadMode;
497+
std::string elfLoadMode;
498498
bool imageOnly = false;
499499
};
500500

tools/projmgr/schemas/common.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2371,7 +2371,7 @@
23712371
},
23722372
"additionalProperties": false,
23732373
"oneOf": [
2374-
{ "required": ["project-context"], "not": {"required": ["image"]} },
2374+
{ "required": ["project-context"], "not": {"required": ["image", "type"]} },
23752375
{ "required": ["image"], "not": {"required": ["project-context"]} }
23762376
]
23772377
},

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +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 = context->loadMode.find(type) != context->loadMode.end() ? context->loadMode.at(type) :
544-
context->loadMode.find("") != context->loadMode.end() ? context->loadMode.at("") : load;
543+
image.load = type == RteConstants::OUTPUT_TYPE_ELF && !context->elfLoadMode.empty() ? context->elfLoadMode : load;
545544
image.pname = context->deviceItem.pname;
546545
image.offset = type == RteConstants::OUTPUT_TYPE_BIN ? context->loadOffset : RteUtils::EMPTY_STRING;
547546
m_runDebug.outputs.push_back(image);

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2595,7 +2595,7 @@ bool ProjMgrWorker::ProcessImages(ContextItem& context) {
25952595
else if (item.context == context.cproject->name + (context.type.build.empty() ? "" : '.' + context.type.build)) {
25962596
context.loadOffset = item.offset;
25972597
if (!item.load.empty()) {
2598-
context.loadMode[item.type] = item.load;
2598+
context.elfLoadMode = item.load;
25992599
}
26002600
}
26012601
}

tools/projmgr/test/data/TestRunDebug/core1.cproject.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ project:
55
device: :cm0_core1
66

77
output:
8-
type: [elf, bin]
8+
type: [hex, bin]

tools/projmgr/test/data/TestRunDebug/ref/run-debug+TestHW3.cbuild-run.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ cbuild-run:
1515
- file: core1/TestHW3/core1.axf
1616
info: generate by core1+TestHW3
1717
type: elf
18-
load: none
18+
load: symbols
19+
pname: cm0_core1
20+
- file: core1/TestHW3/core1.hex
21+
info: generate by core1+TestHW3
22+
type: hex
23+
load: image
1924
pname: cm0_core1
2025
- file: core1/TestHW3/core1.bin
2126
info: generate by core1+TestHW3
2227
type: bin
23-
load: image
28+
load: none
2429
pname: cm0_core1
2530
system-resources:
2631
memory:

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,7 @@ solution:
4646
- project-context: core0
4747
load: none
4848
- project-context: core1
49-
type: elf
50-
load: none
51-
- project-context: core1
52-
type: bin
53-
load: image
49+
load: symbols
5450
debugger:
5551
name: CMSIS-DAP
5652
start-pname: cm0_core1

0 commit comments

Comments
 (0)