Skip to content

Commit dcde7f4

Browse files
authored
Merge branch 'main' into dependabot/github_actions/step-security/harden-runner-2.20.0
2 parents e0c7ea2 + 8802a16 commit dcde7f4

21 files changed

Lines changed: 211 additions & 17 deletions

.github/workflows/buildmgr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ jobs:
380380
submodules: true
381381

382382
- name: Cache ARM GCC
383-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
383+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
384384
with:
385385
key: "${{ matrix.arm_gcc_install_base }}/${{ matrix.installer_name }}"
386386
path: ${{ matrix.installer_name }}
@@ -403,7 +403,7 @@ jobs:
403403
unzip -o $Env:installer_name
404404
405405
- name: Cache CMSIS Pack
406-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
406+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
407407
env:
408408
CACHE_NAME: cmsis_pack
409409
with:
@@ -528,7 +528,7 @@ jobs:
528528
run: mkdir build
529529

530530
- name: Cache ARM GCC
531-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
531+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
532532
with:
533533
key: "${{ env.arm_gcc_install_base }}/${{ env.installer_name }}"
534534
path: ${{ env.installer_name }}
@@ -539,7 +539,7 @@ jobs:
539539
tar -xvf ${{ env.installer_name }}
540540
541541
- name: Cache CMSIS Pack
542-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
542+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
543543
env:
544544
CACHE_NAME: cmsis_pack
545545
with:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
submodules: true
4343

4444
- name: Initialize CodeQL
45-
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
45+
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v3.29.5
4646
with:
4747
languages: cpp
4848
queries: security-and-quality
@@ -58,4 +58,4 @@ jobs:
5858
working-directory: ./build
5959

6060
- name: Perform CodeQL Analysis
61-
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
61+
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v3.29.5

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ jobs:
6666

6767
# Upload the results to GitHub's code scanning dashboard.
6868
- name: "Upload to code-scanning"
69-
uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v3.29.5
69+
uses: github/codeql-action/upload-sarif@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v3.29.5
7070
with:
7171
sarif_file: results.sarif

tools/projmgr/include/ProjMgrParser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ struct CustomItem {
173173
* debug protocol (jtag or swd)
174174
* debug clock speed
175175
* debug configuration file
176+
* device settings
176177
* start pname
177178
* telnet options
178179
* systemview options
@@ -183,6 +184,7 @@ struct DebuggerItem {
183184
std::string protocol;
184185
std::string clock;
185186
std::string dbgconf;
187+
std::map<std::string, std::string> deviceSettings;
186188
std::string startPname;
187189
std::vector<TelnetItem> telnet;
188190
SystemViewItem systemView;

tools/projmgr/include/ProjMgrUtils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,13 @@ class ProjMgrUtils {
284284
*/
285285
static const std::string FormatPath(const std::string& original, const std::string& directory, bool useAbsolutePaths = false);
286286

287+
/**
288+
* @brief parse variable assignments from a dbgconf file
289+
* @param dbgconf path to dbgconf file
290+
* @return map of variable names to assigned values
291+
*/
292+
static std::map<std::string, std::string> ParseDbgconfFile(const std::string& dbgconf);
293+
287294
/**
288295
* @brief adjust relative path fragments in a list of values
289296
* @param vec list of strings that may contain relative paths

tools/projmgr/include/ProjMgrWorker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ struct TemplateItem {
386386
* debug protocol (jtag or swd)
387387
* debug clock speed
388388
* debug configuration file
389+
* device settings
389390
* start pname
390391
* list of gdbserver items
391392
* list of telnet options items
@@ -397,6 +398,7 @@ struct DebuggerType {
397398
std::string protocol;
398399
std::optional<unsigned long long> clock;
399400
std::string dbgconf;
401+
std::map<std::string, std::string> deviceSettings;
400402
std::string startPname;
401403
std::vector<GdbServerItem> gdbserver;
402404
std::map<std::string, TelnetOptionsItem> telnet;

tools/projmgr/include/ProjMgrYamlParser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static constexpr const char* YAML_DEBUG_TOPOLOGY = "debug-topology";
9898
static constexpr const char* YAML_DEBUGGER = "debugger";
9999
static constexpr const char* YAML_DEBUGPORTS = "debugports";
100100
static constexpr const char* YAML_DBGCONF = "dbgconf";
101+
static constexpr const char* YAML_DEVICE_SETTINGS = "device-settings";
101102
static constexpr const char* YAML_DEFAULT = "default";
102103
static constexpr const char* YAML_DEFAULTS = "defaults";
103104
static constexpr const char* YAML_DEFINE = "define";
@@ -370,6 +371,7 @@ class ProjMgrYamlParser {
370371
void ParseString(const YAML::Node& parent, const std::string& key, std::string& value);
371372
void ParseNumber(const YAML::Node& parent, const std::string& file, const std::string& key, std::string& value);
372373
void ParseInt(const YAML::Node& parent, const std::string& key, int& value);
374+
void ParseMapOfStrings(const YAML::Node& parent, const std::string& key, std::map<std::string, std::string>& value);
373375
void ParseVector(const YAML::Node& parent, const std::string& key, std::vector<std::string>& value);
374376
void ParseVectorOfStringPairs(const YAML::Node& parent, const std::string& key, std::vector<std::pair<std::string, std::string>>& value);
375377
void ParseVectorOrString(const YAML::Node& parent, const std::string& key, std::vector<std::string>& value);

tools/projmgr/schemas/common.schema.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2292,11 +2292,18 @@
22922292
"gdbserver": { "$ref": "#/definitions/GdbServersType" },
22932293
"telnet": { "$ref": "#/definitions/TelnetOptionsType" },
22942294
"rtt": { "$ref": "#/definitions/RttOptionsType" },
2295-
"systemview": { "$ref": "#/definitions/SystemViewOptionType" }
2295+
"systemview": { "$ref": "#/definitions/SystemViewOptionType" },
2296+
"device-settings": { "$ref": "#/definitions/DeviceSettingsType" }
22962297
},
22972298
"additionalProperties": true,
22982299
"required": ["name"]
22992300
},
2301+
"DeviceSettingsType": {
2302+
"title": "device-settings:\nDocumentation: https://open-cmsis-pack.github.io/cmsis-toolbox/pyOCD-Debugger/#device-settings",
2303+
"description": "Debugger device settings.",
2304+
"type": "object",
2305+
"additionalProperties": { "type": [ "string", "number", "boolean" ] }
2306+
},
23002307
"RttOptionsType": {
23012308
"title": "rtt:\nDocumentation: https://open-cmsis-pack.github.io/cmsis-toolbox/pyOCD-Debugger/#rtt",
23022309
"description": "Configuration for RTT features.",
@@ -2586,7 +2593,8 @@
25862593
"start-pname": { "type": "string", "description": "Debugger connects at start to this processor." },
25872594
"telnet": { "$ref": "#/definitions/TelnetOptionsType" },
25882595
"rtt": { "$ref": "#/definitions/RttOptionsType" },
2589-
"systemview": { "$ref": "#/definitions/SystemViewOptionType" }
2596+
"systemview": { "$ref": "#/definitions/SystemViewOptionType" },
2597+
"device-settings": { "$ref": "#/definitions/DeviceSettingsType" }
25902598
},
25912599
"additionalProperties": true,
25922600
"required": ["name"]

tools/projmgr/src/ProjMgrCbuildRun.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ProjMgrCbuildRun : public ProjMgrCbuildBase {
2424
void SetFilesNode(YAML::Node node, const std::vector<FilesType>& outputs);
2525
void SetResourcesNode(YAML::Node node, const SystemResourcesType& systemResources);
2626
void SetDebuggerNode(YAML::Node node, const DebuggerType& debugger);
27+
void SetDeviceSettingsNode(YAML::Node node, const std::map<std::string, std::string>& deviceSettings);
2728
void SetDebugVarsNode(YAML::Node node, const DebugVarsType& debugVars);
2829
void SetDebugSequencesNode(YAML::Node node, const std::vector<DebugSequencesType>& algorithms);
2930
void SetDebugSequencesBlockNode(YAML::Node node, const std::vector<DebugSequencesBlockType>& blocks);
@@ -187,10 +188,17 @@ void ProjMgrCbuildRun::SetDebuggerNode(YAML::Node node, const DebuggerType& debu
187188
SetGdbServerNode(node[YAML_GDBSERVER], debugger.gdbserver);
188189
SetTelnetNode(node[YAML_TELNET], debugger.telnet);
189190
SetSystemViewNode(node[YAML_SYSTEMVIEW], debugger.systemView);
191+
SetDeviceSettingsNode(node[YAML_DEVICE_SETTINGS], debugger.deviceSettings);
190192
SetCustomNodes(node, debugger.custom);
191193
}
192194
}
193195

196+
void ProjMgrCbuildRun::SetDeviceSettingsNode(YAML::Node node, const map<string, string>& deviceSettings) {
197+
for (const auto& [key, value] : deviceSettings) {
198+
node[key] = value;
199+
}
200+
}
201+
194202
YAML::Node ProjMgrCbuildRun::GetCustomNode(const CustomItem& value) {
195203
YAML::Node node;
196204
if (!value.scalar.empty()) {

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,14 @@ void ProjMgrRunDebug::CollectDebuggerSettings(const ContextItem& context, const
411411
m_runDebug.debugger = defaultDebugger;
412412
}
413413

414+
// device-settings from dbgconf
415+
if (m_runDebug.debugger.deviceSettings.empty() && !m_runDebug.debugger.dbgconf.empty()) {
416+
m_runDebug.debugger.deviceSettings = ProjMgrUtils::ParseDbgconfFile(m_runDebug.debugger.dbgconf);
417+
}
418+
if (!m_runDebug.debugger.deviceSettings.empty()) {
419+
m_runDebug.debugger.dbgconf.clear();
420+
}
421+
414422
// primary processor: pname of first cproject
415423
if (m_runDebug.debugger.startPname.empty()) {
416424
m_runDebug.debugger.startPname = context.deviceItem.pname;
@@ -451,7 +459,6 @@ void ProjMgrRunDebug::CollectDebuggerSettings(const ContextItem& context, const
451459

452460
// merge custom options
453461
MergeCustomItems(context.debugger.custom, m_runDebug.debugger.custom);
454-
455462
}
456463

457464
void ProjMgrRunDebug::CollectTelnetOptions(const ContextItem& context, DebugAdapterItem& adapter,

0 commit comments

Comments
 (0)