Skip to content

Commit 018cff5

Browse files
authored
[cbuild-run] Remove default debugger protocol and clock
1 parent 9efeefb commit 018cff5

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

tools/projmgr/include/ProjMgrRunDebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ struct DebuggerType {
9797
std::string name;
9898
std::string info;
9999
std::string protocol;
100-
unsigned long long clock = 0;
100+
std::optional<unsigned long long> clock;
101101
std::string dbgconf;
102102
};
103103

tools/projmgr/src/ProjMgrCbuildRun.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ void ProjMgrCbuildRun::SetDebuggersNode(YAML::Node node, const std::vector<Debug
9999
SetNodeValue(debuggerNode[YAML_NAME], item.name);
100100
SetNodeValue(debuggerNode[YAML_INFO], item.info);
101101
SetNodeValue(debuggerNode[YAML_PROTOCOL], item.protocol);
102-
debuggerNode[YAML_CLOCK] = item.clock;
102+
if (item.clock.has_value()) {
103+
debuggerNode[YAML_CLOCK] = item.clock.value();
104+
}
103105
SetNodeValue(debuggerNode[YAML_DBGCONF], FormatPath(item.dbgconf, m_directory));
104106
node.push_back(debuggerNode);
105107
}

tools/projmgr/src/ProjMgrRunDebug.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ using namespace std;
1818
* @brief default debugger parameters
1919
*/
2020
static constexpr const char* DEBUGGER_NAME_DEFAULT = "<default>";
21-
static constexpr const char* DEBUGGER_PROTOCOL_DEFAULT = "swd";
22-
static unsigned long long DEBUGGER_CLOCK_DEFAULT = 10000000;
2321

2422
ProjMgrRunDebug::ProjMgrRunDebug(void) {
2523
// Reserved
@@ -288,10 +286,12 @@ bool ProjMgrRunDebug::CollectSettings(const vector<ContextItem*>& contexts) {
288286
defaultDebugger.name = debugProbe ? debugProbe->GetName() : DEBUGGER_NAME_DEFAULT;
289287
const auto& boardProtocol = debugProbe ? debugProbe->GetAttribute("debugLink") : "";
290288
const auto& deviceProtocol = debugConfig ? debugConfig->GetAttribute("default") : "";
291-
defaultDebugger.protocol = !boardProtocol.empty() ? boardProtocol : !deviceProtocol.empty() ? deviceProtocol : DEBUGGER_PROTOCOL_DEFAULT;
292-
const auto& boardClock = debugProbe ? debugProbe->GetAttributeAsULL("debugClock") : 0;
293-
const auto& deviceClock = debugConfig ? debugConfig->GetAttributeAsULL("clock") : 0;
294-
defaultDebugger.clock = boardClock > 0 ? boardClock : deviceClock > 0 ? deviceClock : DEBUGGER_CLOCK_DEFAULT;
289+
defaultDebugger.protocol = !boardProtocol.empty() ? boardProtocol : deviceProtocol;
290+
if (debugProbe && debugProbe->HasAttribute("debugClock")) {
291+
defaultDebugger.clock = debugProbe->GetAttributeAsULL("debugClock");
292+
} else if (debugConfig && debugConfig->HasAttribute("clock")) {
293+
defaultDebugger.clock = debugConfig->GetAttributeAsULL("clock");
294+
}
295295

296296
// user defined debugger parameters
297297
if (context0->debuggers.size() > 0) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ cbuild-run:
4848
type: svd
4949
debugger:
5050
- name: <default>
51-
protocol: swd
52-
clock: 10000000
5351
dbgconf: ../data/TestRunDebug/RTE/Device/RteTest_ARMCM0_Dual_cm0_core0/ARMCM.dbgconf
5452
debug-vars:
5553
vars: |

0 commit comments

Comments
 (0)