Skip to content

Commit 99b05cb

Browse files
authored
[projmgr] Handle load mode for project-context
1 parent b5bf5db commit 99b05cb

File tree

7 files changed

+24
-4
lines changed

7 files changed

+24
-4
lines changed

tools/projmgr/include/ProjMgrWorker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ struct DebuggerType {
359359
* images
360360
* selected target-set
361361
* load offset for generated binary
362+
* load modes
362363
*/
363364
struct ContextItem {
364365
CdefaultItem* cdefault = nullptr;
@@ -426,6 +427,7 @@ struct ContextItem {
426427
std::vector<ImageItem> images;
427428
std::string targetSet;
428429
std::string loadOffset;
430+
StrMap loadMode;
429431
};
430432

431433
/**

tools/projmgr/schemas/common.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2363,7 +2363,7 @@
23632363
},
23642364
"additionalProperties": false,
23652365
"oneOf": [
2366-
{ "required": ["project-context"], "not": {"required": ["image", "load", "type"]} },
2366+
{ "required": ["project-context"], "not": {"required": ["image"]} },
23672367
{ "required": ["image"], "not": {"required": ["project-context"]} }
23682368
]
23692369
},

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,8 @@ void ProjMgrRunDebug::AddGeneratedImage(const ContextItem* context, const string
532532
image.file = file;
533533
image.info = "generate by " + context->name;
534534
image.type = type;
535-
image.load = load;
535+
image.load = context->loadMode.find(type) != context->loadMode.end() ? context->loadMode.at(type) :
536+
context->loadMode.find("") != context->loadMode.end() ? context->loadMode.at("") : load;
536537
image.pname = context->deviceItem.pname;
537538
image.offset = type == RteConstants::OUTPUT_TYPE_BIN ? context->loadOffset : RteUtils::EMPTY_STRING;
538539
m_runDebug.outputs.push_back(image);

tools/projmgr/src/ProjMgrWorker.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,6 +2540,9 @@ bool ProjMgrWorker::ProcessImages(ContextItem& context) {
25402540
}
25412541
else if (item.context == context.cproject->name + (context.type.build.empty() ? "" : '.' + context.type.build)) {
25422542
context.loadOffset = item.offset;
2543+
if (!item.load.empty()) {
2544+
context.loadMode[item.type] = item.load;
2545+
}
25432546
}
25442547
}
25452548
return true;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
project:
44

55
device: :cm0_core1
6+
7+
output:
8+
type: [elf, 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
@@ -10,12 +10,17 @@ cbuild-run:
1010
- file: out/core0/TestHW3/core0.axf
1111
info: generate by core0+TestHW3
1212
type: elf
13-
load: image+symbols
13+
load: none
1414
pname: cm0_core0
1515
- file: out/core1/TestHW3/core1.axf
1616
info: generate by core1+TestHW3
1717
type: elf
18-
load: image+symbols
18+
load: none
19+
pname: cm0_core1
20+
- file: out/core1/TestHW3/core1.bin
21+
info: generate by core1+TestHW3
22+
type: bin
23+
load: image
1924
pname: cm0_core1
2025
system-resources:
2126
memory:

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ solution:
4444
- set:
4545
images:
4646
- project-context: core0
47+
load: none
4748
- project-context: core1
49+
type: elf
50+
load: none
51+
- project-context: core1
52+
type: bin
53+
load: image
4854
debugger:
4955
name: CMSIS-DAP
5056
start-pname: cm0_core1

0 commit comments

Comments
 (0)