This commit is contained in:
deeaitch committed 2026-10-11 06:30:18 -04:00
1 parent 51fcdb88ac
commit 0708316a37
155 files changed
+5190 -2691

No files matched your search

+89 -65
View File
@@ -175,7 +175,7 @@ Why the Runtime Decode Layer Exists</h1>
</ul>
<p>Because of that, the design uses a dedicated runtime-ready structure:</p>
<ul>
<li><code><a class="el" href="structDecodeDatabase.html" title="Runtime decode database with fast lookup by CAN ID.">DecodeDatabase</a></code></li>
<li><code><a class="el" href="classDecodeDatabase.html" title="Immutable runtime snapshot. Copies share storage; reload replaces a snapshot. Owning lookup handles a...">DecodeDatabase</a></code></li>
<li><code><a class="el" href="structDecodeFrame.html" title="Runtime-ready frame definition.">DecodeFrame</a></code></li>
<li><code><a class="el" href="structDecodeSignal.html" title="Runtime-ready signal definition.">DecodeSignal</a></code></li>
</ul>
@@ -359,7 +359,7 @@ Purpose</h1>
<hr />
<h1><a class="anchor" id="autotoc_md55"></a>
&lt;tt&gt;FrameKey&lt;/tt&gt;</h1>
<p>Fast lookup key for runtime frame matching.</p>
<p>Stable identifier for runtime frame matching and application state.</p>
<p>Fields:</p>
<ul>
<li><code>canId</code></li>
@@ -369,17 +369,15 @@ Purpose</h1>
<hr />
<h1><a class="anchor" id="autotoc_md57"></a>
&lt;tt&gt;DecodeDatabase&lt;/tt&gt;</h1>
<p>Top-level runtime decode container.</p>
<p>Fields:</p>
<p>Immutable runtime snapshot with a private frame index. Build it with <code>DbcDecodeBuilder::Build(parsed)</code> or construct it from <code>std::vector&lt;<a class="el" href="structDecodeFrame.html" title="Runtime-ready frame definition.">DecodeFrame</a>&gt;</code>. Construction rejects duplicate frame keys and duplicate signal names within a frame with <code>std::invalid_argument</code>, including manually supplied metadata.</p>
<ul>
<li><code>frames</code></li>
<li><code>frameIndexByKey</code></li>
<li><code>GetFrames()</code> returns a borrowed <code>const std::vector&lt;<a class="el" href="structDecodeFrame.html" title="Runtime-ready frame definition.">DecodeFrame</a>&gt;&amp;</code>.</li>
<li><code>FindFrame(FrameKey)</code> returns <code>std::shared_ptr&lt;const <a class="el" href="structDecodeFrame.html" title="Runtime-ready frame definition.">DecodeFrame</a>&gt;</code>.</li>
<li><code>FindSignal(SignalKey)</code> returns <code>std::shared_ptr&lt;const <a class="el" href="structDecodeSignal.html" title="Runtime-ready signal definition.">DecodeSignal</a>&gt;</code>.</li>
<li>Missing definitions return an empty handle.</li>
<li>Copying a database shares its snapshot; replacing it installs another snapshot.</li>
</ul>
<p>Conceptually:</p>
<div class="fragment"><div class="line">DecodeDatabase</div>
<div class="line"> ├── vector&lt;DecodeFrame&gt;</div>
<div class="line"> └── unordered_map&lt;FrameKey, index&gt;</div>
</div><!-- fragment --><p>This gives the decoder fast access to a frame definition using CAN ID and frame type.</p>
<p>Frame lookup uses a hash index; signal lookup scans the matched frame's signals. Decoding shares the snapshot without copying definitions or allocating ownership objects per signal.</p>
<hr />
<h1><a class="anchor" id="autotoc_md59"></a>
Decoder Layer</h1>
@@ -405,6 +403,7 @@ Decoder Layer</h1>
<p>Fields:</p>
<ul>
<li><code>definition</code></li>
<li><code>key</code></li>
<li><code>rawValue</code></li>
<li><code>physicalValue</code></li>
<li><code>valid</code></li>
@@ -429,13 +428,44 @@ Raw value representation and precision</h2>
<p>Fields:</p>
<ul>
<li><code>definition</code></li>
<li><code>key</code></li>
<li><code>signals</code></li>
<li><code>valid</code></li>
</ul>
<p><code>valid</code> means a matching frame definition was found. Check each signal's <code>valid</code> separately: insufficient payload data can leave individual signals invalid even when the frame is valid. An unknown frame returns <code>valid == false</code>.</p>
<p>The frame and signal <code>definition</code> pointers refer into <code><a class="el" href="structDecodeDatabase.html" title="Runtime decode database with fast lookup by CAN ID.">DecodeDatabase</a></code>. Keep that database alive and avoid changes that invalidate its frame or signal storage while using decoded results. The decoder applies factor and offset; it does not clamp physical values to the declared minimum and maximum.</p>
<p>The decoder applies factor and offset; it does not clamp physical values to the declared minimum and maximum.</p>
<h2><a class="anchor" id="autotoc_md67"></a>
Definition ownership and reload</h2>
<p><code><a class="el" href="structDecodedFrameValue.html#a33e971ba10030506007aa201c89f351d">DecodedFrameValue::definition</a></code> and <code><a class="el" href="structDecodedSignalValue.html#a828b5ef7faefc14fbf5dbd46249bcad2">DecodedSignalValue::definition</a></code> are owning <code>std::shared_ptr&lt;const ...&gt;</code> handles. Each handle retains the immutable runtime snapshot. Definitions remain valid until the last database copy, lookup handle, or decoded result owning that snapshot is released. An independently copied signal result retains its definition even after the parent frame result is removed. Copying or moving results preserves ownership.</p>
<p>Reload by assigning a newly built database. Stored results continue to describe the old DBC, including its units, scaling, comments, and <code>VAL_</code> descriptions; subsequent decoding uses the new DBC. Removed definitions cannot be found in the new database, but old results safely retain their old definitions. Keeping even one signal handle retains the whole old snapshot; release stored results when that metadata is no longer needed.</p>
<p><code>GetFrames()</code> is a borrowed view. References, iterators, and raw pointers obtained from it or from a handle's <code>.get()</code> do not retain ownership. Keep an owning handle or an unchanged database copy while using them. Do not retain mutable aliases into a vector moved into the database constructor. The raw string pointer from <code>GetValueDescription()</code> follows the same rule: keep the signal definition handle alive while using the string.</p>
<p>Parsed <code><a class="el" href="structDbcDatabase.html" title="Parsed DBC content stored in a simple internal form.">DbcDatabase</a></code>/<code><a class="el" href="structFrameInfo.html" title="Describes one CAN frame from a DBC file.">FrameInfo</a></code>/<code><a class="el" href="structSignalInfo.html" title="Describes one signal inside a DBC frame.">SignalInfo</a></code> remain ordinary mutable value containers: borrowed pointers follow standard vector invalidation rules. Builders copy their metadata, so parsed input may be changed or destroyed after building. Tree nodes own metadata copies; the Qt model owns its tree and invalidates model indexes on reset. Runtime handles do not depend on the parsed database or tree. Synchronize replacement of a shared database variable with decoding; immutable snapshots do not make concurrent assignment to the same object safe.</p>
<h2><a class="anchor" id="autotoc_md68"></a>
Stable frame and signal identifiers</h2>
<p><code><a class="el" href="structDecodedFrameValue.html#a32143efe2023a1ecd977a9ae93e50b73">DecodedFrameValue::key</a></code> is a <code><a class="el" href="structFrameKey.html" title="Stable frame identifier: normalized CAN ID and frame type.">FrameKey</a></code> (normalized <code>canId</code>, <code>isExtended</code>), also available through <code>DecodeFrame::GetKey()</code>. <code><a class="el" href="structDecodedSignalValue.html#a33df0fcd92b23b3e08539906fc6b4c4a">DecodedSignalValue::key</a></code> is a <code><a class="el" href="structSignalKey.html">SignalKey</a></code> (frame key, exact case-sensitive signal name). Both are value types with equality and hashers (<code><a class="el" href="structFrameKeyHasher.html" title="Hasher for frame key.">FrameKeyHasher</a></code>, <code><a class="el" href="structSignalKeyHasher.html">SignalKeyHasher</a></code>) for application maps and saved selections. Construct the same keys from parsed metadata when needed; do not use addresses or vector positions as identifiers.</p>
<p>Keys stay equal across reloads and reordering when their components stay equal. Frame renaming and changes to units, bit layout, scaling, or descriptions do not change a key. Changing a CAN ID/frame type or renaming a signal produces a new key. The same name in different frames and standard/extended frames with the same numeric CAN ID remain distinct. Keys identify definitions within one logical DBC database; applications combining databases must add their own database ID. A key is not a version identifier: matching keys in different snapshots may have different metadata. Use <code>valid</code>/the definition handle to distinguish a matched result; default keys alone do not indicate successful decoding.</p>
<div class="fragment"><div class="line"><a class="code hl_class" href="classDecodeDatabase.html">DecodeDatabase</a> runtime = <a class="code hl_class" href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a>().<a class="code hl_function" href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">Build</a>(parsed);</div>
<div class="line"><a class="code hl_struct" href="structDecodedFrameValue.html">DecodedFrameValue</a> stored = <a class="code hl_class" href="classDbcDecoder.html">DbcDecoder</a>().<a class="code hl_function" href="classDbcDecoder.html#a345951ffe5d943a70d3a1ea1f39e74f7">Decode</a>(runtime, rawFrame);</div>
<div class="line"><span class="keywordflow">if</span> (stored.<a class="code hl_variable" href="structDecodedFrameValue.html#a4f51c31110dba1f73a763c596372beb0">valid</a> &amp;&amp; !stored.signals.empty()) {</div>
<div class="line"> <a class="code hl_struct" href="structDecodedSignalValue.html">DecodedSignalValue</a> saved = stored.signals.front();</div>
<div class="line"> <a class="code hl_struct" href="structSignalKey.html">SignalKey</a> selection = saved.<a class="code hl_variable" href="structDecodedSignalValue.html#a33df0fcd92b23b3e08539906fc6b4c4a">key</a>;</div>
<div class="line"> runtime = <a class="code hl_class" href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a>().<a class="code hl_function" href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">Build</a>(parser.ParseFile(<span class="stringliteral">&quot;updated.dbc&quot;</span>));</div>
<div class="line"> std::shared_ptr&lt;const DecodeSignal&gt; current = runtime.FindSignal(selection);</div>
<div class="line"> <span class="comment">// saved.definition retains old metadata; current holds new metadata or is empty.</span></div>
<div class="line">}</div>
<div class="ttc" id="aclassDbcDecodeBuilder_html"><div class="ttname"><a href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a></div><div class="ttdoc">Converts parsed DBC data into runtime decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decode__builder_8h_source.html#l00021">dbc_decode_builder.h:21</a></div></div>
<div class="ttc" id="aclassDbcDecodeBuilder_html_a2bc6386dfb5e58976c42e22c19ec471b"><div class="ttname"><a href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">DbcDecodeBuilder::Build</a></div><div class="ttdeci">DecodeDatabase Build(const DbcDatabase &amp;source) const</div><div class="ttdoc">Build runtime decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decode__builder_8cpp_source.html#l00015">dbc_decode_builder.cpp:15</a></div></div>
<div class="ttc" id="aclassDbcDecoder_html"><div class="ttname"><a href="classDbcDecoder.html">DbcDecoder</a></div><div class="ttdoc">Runtime CAN decoder using prebuilt decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00074">dbc_decoder.h:74</a></div></div>
<div class="ttc" id="aclassDbcDecoder_html_a345951ffe5d943a70d3a1ea1f39e74f7"><div class="ttname"><a href="classDbcDecoder.html#a345951ffe5d943a70d3a1ea1f39e74f7">DbcDecoder::Decode</a></div><div class="ttdeci">DecodedFrameValue Decode(const DecodeDatabase &amp;database, const RawCanFrame &amp;frame) const</div><div class="ttdoc">Decode one raw CAN frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8cpp_source.html#l00021">dbc_decoder.cpp:21</a></div></div>
<div class="ttc" id="aclassDecodeDatabase_html"><div class="ttname"><a href="classDecodeDatabase.html">DecodeDatabase</a></div><div class="ttdoc">Immutable runtime snapshot. Copies share storage; reload replaces a snapshot. Owning lookup handles a...</div><div class="ttdef"><b>Definition</b> <a href="decode__database_8h_source.html#l00087">decode_database.h:87</a></div></div>
<div class="ttc" id="astructDecodedFrameValue_html"><div class="ttname"><a href="structDecodedFrameValue.html">DecodedFrameValue</a></div><div class="ttdoc">Fully decoded frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00062">dbc_decoder.h:62</a></div></div>
<div class="ttc" id="astructDecodedFrameValue_html_a4f51c31110dba1f73a763c596372beb0"><div class="ttname"><a href="structDecodedFrameValue.html#a4f51c31110dba1f73a763c596372beb0">DecodedFrameValue::valid</a></div><div class="ttdeci">bool valid</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00066">dbc_decoder.h:66</a></div></div>
<div class="ttc" id="astructDecodedSignalValue_html"><div class="ttname"><a href="structDecodedSignalValue.html">DecodedSignalValue</a></div><div class="ttdoc">One decoded signal value.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00043">dbc_decoder.h:43</a></div></div>
<div class="ttc" id="astructDecodedSignalValue_html_a33df0fcd92b23b3e08539906fc6b4c4a"><div class="ttname"><a href="structDecodedSignalValue.html#a33df0fcd92b23b3e08539906fc6b4c4a">DecodedSignalValue::key</a></div><div class="ttdeci">SignalKey key</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00045">dbc_decoder.h:45</a></div></div>
<div class="ttc" id="astructSignalKey_html"><div class="ttname"><a href="structSignalKey.html">SignalKey</a></div><div class="ttdef"><b>Definition</b> <a href="definition__key_8h_source.html#l00042">definition_key.h:42</a></div></div>
</div><!-- fragment --><p><b>API migration:</b> replace reads of <code>runtime.frames</code> with <code>runtime.GetFrames()</code>. To edit runtime definitions, prepare a vector and construct a new database; <code>frameIndexByKey</code> is now private and built automatically. <code><a class="el" href="classDbcDecoder.html#a4005c4311f57b7faf21c0cb31463039c" title="Find frame definition by CAN ID.">DbcDecoder::FindFrame</a></code> and result <code>definition</code> fields now use owning handles instead of raw pointers; <code>definition-&gt;name</code>, boolean/null checks, and existing decode calls remain usable. Use <code>.get()</code> only for temporary raw-pointer interoperation with an owner alive.</p>
<hr />
<h1><a class="anchor" id="autotoc_md68"></a>
<h1><a class="anchor" id="autotoc_md70"></a>
&lt;tt&gt;DbcDecoder&lt;/tt&gt;</h1>
<p>Main runtime decoder class.</p>
<p>Responsibilities:</p>
@@ -452,7 +482,7 @@ Raw value representation and precision</h2>
<li><code>Decode(...)</code></li>
</ul>
<hr />
<h1><a class="anchor" id="autotoc_md70"></a>
<h1><a class="anchor" id="autotoc_md72"></a>
Parser Support</h1>
<p>The current parser supports the following DBC elements:</p>
<ul>
@@ -463,7 +493,7 @@ Parser Support</h1>
<li><code>VAL_</code> signal value descriptions</li>
<li>basic <code>M</code> / <code>mN</code> multiplexing</li>
</ul>
<h2><a class="anchor" id="autotoc_md71"></a>
<h2><a class="anchor" id="autotoc_md73"></a>
Structured diagnostics</h2>
<p><code>ParseFileWithDiagnostics(path)</code> returns <code><a class="el" href="structDbcParseResult.html">DbcParseResult</a></code> containing <code>database</code> and <code>diagnostics</code>. Each <code><a class="el" href="structDbcDiagnostic.html">DbcDiagnostic</a></code> has <code>severity</code>, <code>code</code>, <code>filePath</code>, <code>lineNumber</code>, and <code>message</code>. Paths preserve the caller's supplied spelling. Lines are one-based physical lines, including blank lines; file-level errors use zero.</p>
<div class="fragment"><div class="line"><span class="keyword">const</span> <a class="code hl_class" href="classDbcParser.html">DbcParser</a> parser;</div>
@@ -473,16 +503,13 @@ Structured diagnostics</h2>
<div class="line"> &lt;&lt; <span class="stringliteral">&quot;: &quot;</span> &lt;&lt; diagnostic.message &lt;&lt; <span class="charliteral">&#39;\n&#39;</span>;</div>
<div class="line">}</div>
<div class="line"><span class="keywordflow">if</span> (!result.HasErrors()) {</div>
<div class="line"> <span class="keyword">const</span> <a class="code hl_struct" href="structDecodeDatabase.html">DecodeDatabase</a> runtime = <a class="code hl_class" href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a>().<a class="code hl_function" href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">Build</a>(result.database);</div>
<div class="line"> <span class="keyword">const</span> <a class="code hl_class" href="classDecodeDatabase.html">DecodeDatabase</a> runtime = <a class="code hl_class" href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a>().<a class="code hl_function" href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">Build</a>(result.database);</div>
<div class="line"> <span class="comment">// Inspect warnings before relying on decoding results.</span></div>
<div class="line">}</div>
<div class="ttc" id="aclassDbcDecodeBuilder_html"><div class="ttname"><a href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a></div><div class="ttdoc">Converts parsed DBC data into runtime decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decode__builder_8h_source.html#l00021">dbc_decode_builder.h:21</a></div></div>
<div class="ttc" id="aclassDbcDecodeBuilder_html_a2bc6386dfb5e58976c42e22c19ec471b"><div class="ttname"><a href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">DbcDecodeBuilder::Build</a></div><div class="ttdeci">DecodeDatabase Build(const DbcDatabase &amp;source) const</div><div class="ttdoc">Build runtime decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decode__builder_8cpp_source.html#l00014">dbc_decode_builder.cpp:14</a></div></div>
<div class="ttc" id="aclassDbcParser_html"><div class="ttname"><a href="classDbcParser.html">DbcParser</a></div><div class="ttdoc">Minimal DBC parser.</div><div class="ttdef"><b>Definition</b> <a href="dbc__parser_8h_source.html#l00033">dbc_parser.h:33</a></div></div>
<div class="ttc" id="aclassDbcParser_html_a0e915ce79c2e3d4c95a5aaf2bf0409bc"><div class="ttname"><a href="classDbcParser.html#a0e915ce79c2e3d4c95a5aaf2bf0409bc">DbcParser::ParseFileWithDiagnostics</a></div><div class="ttdeci">DbcParseResult ParseFileWithDiagnostics(const std::string &amp;filePath) const</div><div class="ttdoc">Parse with warnings and a structured first error instead of throwing.</div><div class="ttdef"><b>Definition</b> <a href="dbc__parser_8cpp_source.html#l00044">dbc_parser.cpp:44</a></div></div>
<div class="ttc" id="astructDbcDiagnostic_html"><div class="ttname"><a href="structDbcDiagnostic.html">DbcDiagnostic</a></div><div class="ttdef"><b>Definition</b> <a href="dbc__diagnostic_8h_source.html#l00025">dbc_diagnostic.h:25</a></div></div>
<div class="ttc" id="astructDbcParseResult_html"><div class="ttname"><a href="structDbcParseResult.html">DbcParseResult</a></div><div class="ttdef"><b>Definition</b> <a href="dbc__diagnostic_8h_source.html#l00033">dbc_diagnostic.h:33</a></div></div>
<div class="ttc" id="astructDecodeDatabase_html"><div class="ttname"><a href="structDecodeDatabase.html">DecodeDatabase</a></div><div class="ttdoc">Runtime decode database with fast lookup by CAN ID.</div><div class="ttdef"><b>Definition</b> <a href="decode__database_8h_source.html#l00109">decode_database.h:109</a></div></div>
</div><!-- fragment --><table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadNone">Severity / code </th><th class="markdownTableHeadNone">Meaning </th></tr>
@@ -506,9 +533,9 @@ Structured diagnostics</h2>
<p>Common <code>VERSION</code>, <code>NS_</code>, <code>BS_</code>, and <code>BU_</code> headers produce no diagnostics. Single-token symbols inside the <code>NS_</code> declaration list are quiet regardless of indentation, even when they name unsupported syntax. Frame, signal, bus, and node definitions or a line with arguments end the list. Actual unsupported statements outside that list are reported. Node and bus metadata are not stored. Other comment forms (<code>CM_</code>, <code>CM_ BU_</code>, <code>CM_ EV_</code>) are ignored by the comment handler; comments only attach to already parsed frames/signals. Supported statements currently require one physical line.</p>
<p><code>ParseFile(path)</code> remains compatible: it returns the database, discards warnings, and throws <code>std::runtime_error</code> on the first error with the existing <code>path:line:</code> format. Use <code>ParseFileWithDiagnostics</code> to see skipped syntax. Resource failures such as allocation errors may still throw.</p>
<hr />
<h1><a class="anchor" id="autotoc_md73"></a>
<h1><a class="anchor" id="autotoc_md75"></a>
Supported DBC Syntax</h1>
<h1><a class="anchor" id="autotoc_md74"></a>
<h1><a class="anchor" id="autotoc_md76"></a>
Frame definition</h1>
<p>Example:</p>
<div class="fragment"><div class="line">BO_ 256 EngineData: 8 EEC1</div>
@@ -520,7 +547,7 @@ Frame definition</h1>
<li>transmitter ECU</li>
</ul>
<hr />
<h2><a class="anchor" id="autotoc_md76"></a>
<h2><a class="anchor" id="autotoc_md78"></a>
Frame validation and parse errors</h2>
<p><code>BO_</code> definitions require a decimal CAN ID, a nonempty single-token frame name, a colon, a decimal payload length, and a transmitter token. Spaces or tabs may separate fields, and whitespace before the colon is accepted. Additional trailing fields are rejected.</p>
<p>Numeric fields must contain decimal digits only; signs, hexadecimal notation, fractional values, suffixes, and overflow are rejected. CAN IDs may contain the 29-bit identifier plus the optional DBC extended flag (bit 31). Bits 29 and 30 are rejected rather than silently discarded. For compatibility, unflagged IDs above <code>0x7FF</code> are still treated as extended.</p>
@@ -529,7 +556,7 @@ Frame validation and parse errors</h2>
<div class="fragment"><div class="line">example.dbc:3: Invalid CAN ID: invalid</div>
</div><!-- fragment --><p>Frame and signal definitions are validated as described here; comprehensive DBC grammar coverage is still planned. File-open exceptions contain the path but no line number. The structured diagnostic API uses line zero for file-level errors.</p>
<hr />
<h1><a class="anchor" id="autotoc_md78"></a>
<h1><a class="anchor" id="autotoc_md80"></a>
Signal definition</h1>
<p>Example:</p>
<div class="fragment"><div class="line">SG_ EngineSpeed : 0|16@1+ (0.125,0) [0|8000] &quot;rpm&quot; ECU1,ECU2</div>
@@ -548,7 +575,7 @@ Signal definition</h1>
<li>receivers</li>
</ul>
<hr />
<h2><a class="anchor" id="autotoc_md80"></a>
<h2><a class="anchor" id="autotoc_md82"></a>
Signal validation and parse errors</h2>
<p><code>SG_</code> statements are matched completely. Signal names must be nonempty and contain no whitespace. Spaces and tabs are accepted between syntax elements; byte order and signedness remain adjacent (<code>@0+</code>, <code>@0-</code>, <code>@1+</code>, or <code>@1-</code>). A quoted unit (which may be empty) and a nonempty comma-separated receiver list are required. Unexpected trailing fields are rejected.</p>
<p>Start bits must be unsigned decimal integers fitting <code>uint32_t</code>; lengths must be within <code>1..64</code> bits. Signs, fractional values, numeric suffixes, and overflow are rejected for these fields. Every signal bit must fit within the frame's declared payload length, using Intel increasing bit positions or Motorola sawtooth traversal. This uses the stored payload length without introducing an additional CAN or CAN FD payload limit.</p>
@@ -556,7 +583,7 @@ Signal validation and parse errors</h2>
<p>Basic multiplexing markers <code>M</code> and <code>mN</code> are supported as described below. Overlapping signals are rejected unless their branch values differ. Duplicate frame keys and signal names within a frame are rejected.</p>
<p>Invalid signal definitions stop parsing with <code>path:line: description</code>, including when the signal exceeds the declared payload length.</p>
<hr />
<h1><a class="anchor" id="autotoc_md82"></a>
<h1><a class="anchor" id="autotoc_md84"></a>
Basic multiplexing</h1>
<div class="fragment"><div class="line">BO_ 256 Status: 3 ECU</div>
<div class="line"> SG_ Mode M : 0|8@1+ (1,0) [0|255] &quot;&quot; ECU</div>
@@ -583,7 +610,7 @@ Basic multiplexing</h1>
</table>
<p>All statuses except <code>Valid</code> have <code>valid == false</code>; their numeric fields contain no decoded data and <code>GetValueDescription()</code> returns nullptr. Check <code>status</code> to distinguish inactive branches from errors. Consumers constructing runtime metadata manually must obey the same non-overlap rules as the parser. Extended and nested multiplexing are outside this stage and are explicitly rejected, rather than silently decoded as unconditional signals.</p>
<hr />
<h1><a class="anchor" id="autotoc_md84"></a>
<h1><a class="anchor" id="autotoc_md86"></a>
Comments</h1>
<p>Frame comment example:</p>
<div class="fragment"><div class="line">CM_ BO_ 256 &quot;Engine data frame&quot;;</div>
@@ -595,7 +622,7 @@ Comments</h1>
<li><code><a class="el" href="structSignalInfo.html#ac99ba7563a5dad01e39c4257216953f5">SignalInfo::comment</a></code></li>
</ul>
<hr />
<h1><a class="anchor" id="autotoc_md86"></a>
<h1><a class="anchor" id="autotoc_md88"></a>
CAN ID Normalization</h1>
<p>The parser normalizes frame identifiers.</p>
<p>Common DBC behavior:</p>
@@ -610,7 +637,7 @@ CAN ID Normalization</h1>
</ul>
<p>This is important both for correct lookup and for future interoperability with live CAN APIs.</p>
<hr />
<h1><a class="anchor" id="autotoc_md88"></a>
<h1><a class="anchor" id="autotoc_md90"></a>
PGN Extraction</h1>
<p>PGN is derived only when the frame is treated as extended.</p>
<p>The current logic is simplified J1939 extraction:</p>
@@ -621,7 +648,7 @@ PGN Extraction</h1>
</ul>
<p>This is enough for a practical start but should not be treated as full J1939 validation.</p>
<hr />
<h1><a class="anchor" id="autotoc_md90"></a>
<h1><a class="anchor" id="autotoc_md92"></a>
Decode Flow</h1>
<p>Typical runtime decode flow:</p>
<div class="fragment"><div class="line">RawCanFrame</div>
@@ -636,7 +663,7 @@ Decode Flow</h1>
<div class="line"> ↓</div>
<div class="line">DecodedFrameValue</div>
</div><!-- fragment --><hr />
<h1><a class="anchor" id="autotoc_md92"></a>
<h1><a class="anchor" id="autotoc_md94"></a>
Intel and Motorola Extraction</h1>
<p>The decoder currently has separate extraction paths:</p>
<ul>
@@ -647,7 +674,7 @@ Intel and Motorola Extraction</h1>
<p>Intel and Motorola require different bit extraction logic.</p>
<p>This is one of the main reasons why the runtime decode layer should be explicit and prepared in advance.</p>
<hr />
<h1><a class="anchor" id="autotoc_md94"></a>
<h1><a class="anchor" id="autotoc_md96"></a>
Example Usage</h1>
<p>Include the public headers from the <code>core/</code> include directory supplied by <code>core/core.pri</code>:</p>
<div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="dbc__parser_8h.html">dbc_parser.h</a>&quot;</span></div>
@@ -658,23 +685,23 @@ Example Usage</h1>
<div class="ttc" id="adbc__decoder_8h_html"><div class="ttname"><a href="dbc__decoder_8h.html">dbc_decoder.h</a></div><div class="ttdoc">Created: 2026-03-13 Author: Deeaitch (Dim. Himro)</div></div>
<div class="ttc" id="adbc__parser_8h_html"><div class="ttname"><a href="dbc__parser_8h.html">dbc_parser.h</a></div><div class="ttdoc">Created: 2026-03-13 Author: Deeaitch (Dim. Himro)</div></div>
<div class="ttc" id="adbc__tree__builder_8h_html"><div class="ttname"><a href="dbc__tree__builder_8h.html">dbc_tree_builder.h</a></div><div class="ttdoc">Created: 2026-03-13 Author: Deeaitch (Dim. Himro)</div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md95"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md97"></a>
Parse DBC</h2>
<div class="fragment"><div class="line"><a class="code hl_class" href="classDbcParser.html">DbcParser</a> parser;</div>
<div class="line"><a class="code hl_struct" href="structDbcDatabase.html">DbcDatabase</a> database = parser.<a class="code hl_function" href="classDbcParser.html#aef72826942c9095d653fafa435855e56">ParseFile</a>(<span class="stringliteral">&quot;example.dbc&quot;</span>);</div>
<div class="ttc" id="aclassDbcParser_html_aef72826942c9095d653fafa435855e56"><div class="ttname"><a href="classDbcParser.html#aef72826942c9095d653fafa435855e56">DbcParser::ParseFile</a></div><div class="ttdeci">DbcDatabase ParseFile(const std::string &amp;filePath) const</div><div class="ttdoc">Parse DBC file.</div><div class="ttdef"><b>Definition</b> <a href="dbc__parser_8cpp_source.html#l00031">dbc_parser.cpp:31</a></div></div>
<div class="ttc" id="astructDbcDatabase_html"><div class="ttname"><a href="structDbcDatabase.html">DbcDatabase</a></div><div class="ttdoc">Parsed DBC content stored in a simple internal form.</div><div class="ttdef"><b>Definition</b> <a href="dbc__database_8h_source.html#l00022">dbc_database.h:22</a></div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md96"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md98"></a>
Build UI tree</h2>
<div class="fragment"><div class="line"><a class="code hl_class" href="classDbcTreeBuilder.html">DbcTreeBuilder</a> treeBuilder;</div>
<div class="line">std::unique_ptr&lt;TreeNode&gt; root = treeBuilder.<a class="code hl_function" href="classDbcTreeBuilder.html#a7e57d067d831b14b383947fd125edd4b">Build</a>(database);</div>
<div class="ttc" id="aclassDbcTreeBuilder_html"><div class="ttname"><a href="classDbcTreeBuilder.html">DbcTreeBuilder</a></div><div class="ttdoc">Builds a simple tree from parsed DBC database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__tree__builder_8h_source.html#l00023">dbc_tree_builder.h:23</a></div></div>
<div class="ttc" id="aclassDbcTreeBuilder_html_a7e57d067d831b14b383947fd125edd4b"><div class="ttname"><a href="classDbcTreeBuilder.html#a7e57d067d831b14b383947fd125edd4b">DbcTreeBuilder::Build</a></div><div class="ttdeci">std::unique_ptr&lt; TreeNode &gt; Build(const DbcDatabase &amp;database) const</div><div class="ttdoc">Build tree representation of parsed DBC data.</div><div class="ttdef"><b>Definition</b> <a href="dbc__tree__builder_8cpp_source.html#l00014">dbc_tree_builder.cpp:14</a></div></div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md97"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md99"></a>
Build runtime decode database</h2>
<div class="fragment"><div class="line"><a class="code hl_class" href="classDbcDecodeBuilder.html">DbcDecodeBuilder</a> decodeBuilder;</div>
<div class="line"><a class="code hl_struct" href="structDecodeDatabase.html">DecodeDatabase</a> decodeDatabase = decodeBuilder.<a class="code hl_function" href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">Build</a>(database);</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md98"></a>
<div class="line"><a class="code hl_class" href="classDecodeDatabase.html">DecodeDatabase</a> decodeDatabase = decodeBuilder.<a class="code hl_function" href="classDbcDecodeBuilder.html#a2bc6386dfb5e58976c42e22c19ec471b">Build</a>(database);</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md100"></a>
Decode a raw frame</h2>
<div class="fragment"><div class="line"><a class="code hl_struct" href="structRawCanFrame.html">RawCanFrame</a> rawFrame;</div>
<div class="line">rawFrame.<a class="code hl_variable" href="structRawCanFrame.html#a2d0e7fa0e3d5c20bbed55ed8f7888ff4">canId</a> = 256; <span class="comment">// EngineData from the DBC example above</span></div>
@@ -683,15 +710,12 @@ Decode a raw frame</h2>
<div class="line"> </div>
<div class="line"><a class="code hl_class" href="classDbcDecoder.html">DbcDecoder</a> decoder;</div>
<div class="line"><a class="code hl_struct" href="structDecodedFrameValue.html">DecodedFrameValue</a> decoded = decoder.<a class="code hl_function" href="classDbcDecoder.html#a345951ffe5d943a70d3a1ea1f39e74f7">Decode</a>(decodeDatabase, rawFrame);</div>
<div class="ttc" id="aclassDbcDecoder_html"><div class="ttname"><a href="classDbcDecoder.html">DbcDecoder</a></div><div class="ttdoc">Runtime CAN decoder using prebuilt decode database.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00072">dbc_decoder.h:72</a></div></div>
<div class="ttc" id="aclassDbcDecoder_html_a345951ffe5d943a70d3a1ea1f39e74f7"><div class="ttname"><a href="classDbcDecoder.html#a345951ffe5d943a70d3a1ea1f39e74f7">DbcDecoder::Decode</a></div><div class="ttdeci">DecodedFrameValue Decode(const DecodeDatabase &amp;database, const RawCanFrame &amp;frame) const</div><div class="ttdoc">Decode one raw CAN frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8cpp_source.html#l00031">dbc_decoder.cpp:31</a></div></div>
<div class="ttc" id="astructDecodedFrameValue_html"><div class="ttname"><a href="structDecodedFrameValue.html">DecodedFrameValue</a></div><div class="ttdoc">Fully decoded frame.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00061">dbc_decoder.h:61</a></div></div>
<div class="ttc" id="astructRawCanFrame_html"><div class="ttname"><a href="structRawCanFrame.html">RawCanFrame</a></div><div class="ttdoc">Raw CAN frame used for runtime or trace decoding.</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00024">dbc_decoder.h:24</a></div></div>
<div class="ttc" id="astructRawCanFrame_html_a0acb487612104c99c9907344c035df83"><div class="ttname"><a href="structRawCanFrame.html#a0acb487612104c99c9907344c035df83">RawCanFrame::data</a></div><div class="ttdeci">std::vector&lt; std::uint8_t &gt; data</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00027">dbc_decoder.h:27</a></div></div>
<div class="ttc" id="astructRawCanFrame_html_a2d0e7fa0e3d5c20bbed55ed8f7888ff4"><div class="ttname"><a href="structRawCanFrame.html#a2d0e7fa0e3d5c20bbed55ed8f7888ff4">RawCanFrame::canId</a></div><div class="ttdeci">std::uint32_t canId</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00025">dbc_decoder.h:25</a></div></div>
<div class="ttc" id="astructRawCanFrame_html_a462193d275adc1dba8bd18ffa0e36bb7"><div class="ttname"><a href="structRawCanFrame.html#a462193d275adc1dba8bd18ffa0e36bb7">RawCanFrame::isExtended</a></div><div class="ttdeci">bool isExtended</div><div class="ttdef"><b>Definition</b> <a href="dbc__decoder_8h_source.html#l00026">dbc_decoder.h:26</a></div></div>
</div><!-- fragment --><hr />
<h1><a class="anchor" id="autotoc_md100"></a>
<h1><a class="anchor" id="autotoc_md102"></a>
Unified Decode Strategy</h1>
<p>A key design goal is that the same decoder should work for both:</p>
<ul>
@@ -699,7 +723,7 @@ Unified Decode Strategy</h1>
<li>trace replay frames</li>
</ul>
<p>That means this architecture supports:</p>
<h2><a class="anchor" id="autotoc_md101"></a>
<h2><a class="anchor" id="autotoc_md103"></a>
live path</h2>
<div class="fragment"><div class="line">live CAN input</div>
<div class="line"> ↓</div>
@@ -708,7 +732,7 @@ live path</h2>
<div class="line">DbcDecoder</div>
<div class="line"> ↓</div>
<div class="line">decoded signal values</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md102"></a>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md104"></a>
trace path</h2>
<div class="fragment"><div class="line">trace reader</div>
<div class="line"> ↓</div>
@@ -719,7 +743,7 @@ trace path</h2>
<div class="line">decoded signal values</div>
</div><!-- fragment --><p>This avoids duplicating decode logic in two separate parts of the application.</p>
<hr />
<h1><a class="anchor" id="autotoc_md104"></a>
<h1><a class="anchor" id="autotoc_md106"></a>
Intended Use in FrameTap</h1>
<p>This module is meant to support at least the following FrameTap workflows:</p>
<ul>
@@ -745,7 +769,7 @@ Intended Use in FrameTap</h1>
<div class="line"> - live frames</div>
<div class="line"> - trace replay</div>
</div><!-- fragment --><hr />
<h1><a class="anchor" id="autotoc_md106"></a>
<h1><a class="anchor" id="autotoc_md108"></a>
Why the Tree Is Not Enough</h1>
<p>The tree exists for browsing.</p>
<p>However, runtime decode should not rely on tree traversal because that would introduce unnecessary coupling and inefficiency.</p>
@@ -755,9 +779,9 @@ Why the Tree Is Not Enough</h1>
<li>minimal interpretation at decode time</li>
<li>direct signal definitions already prepared</li>
</ul>
<p>That is why <code><a class="el" href="structDecodeDatabase.html" title="Runtime decode database with fast lookup by CAN ID.">DecodeDatabase</a></code> is a separate layer.</p>
<p>That is why <code><a class="el" href="classDecodeDatabase.html" title="Immutable runtime snapshot. Copies share storage; reload replaces a snapshot. Owning lookup handles a...">DecodeDatabase</a></code> is a separate layer.</p>
<hr />
<h1><a class="anchor" id="autotoc_md108"></a>
<h1><a class="anchor" id="autotoc_md110"></a>
Statement Handler Factory</h1>
<p><code><a class="el" href="classDbcParser.html" title="Minimal DBC parser.">DbcParser</a></code> owns file reading, trimming, line numbers, and error reporting. Each <code>ParseFile()</code> call creates a fresh <code><a class="el" href="structDbcParseContext.html">DbcParseContext</a></code> and a <code><a class="el" href="classDbcStatementDispatcher.html">DbcStatementDispatcher</a></code>. The context contains the parsed database and current frame; handlers receive it by reference and retain no parsing state.</p>
<p>The dispatcher uses <code><a class="el" href="classTypeFactory.html" title="Registry-based factory for creating objects by runtime identifier.">TypeFactory</a>&lt;std::string, <a class="el" href="classDbcStatementHandler.html">DbcStatementHandler</a>&gt;</code> to create registered handlers once per parsing session, then reuses them for all matching lines:</p>
@@ -778,7 +802,7 @@ Statement Handler Factory</h1>
</div><!-- fragment --><p>Registration creates one handler; replacing a registration replaces that instance. Register during initialization before dispatching. A line is routed using its full first whitespace-delimited keyword, so <code>BO_TX_BU_</code> cannot match <code>BO_</code>. Unregistered keywords produce <code>UnsupportedStatement</code> warnings through <code>ParseFileWithDiagnostics</code>. <code>SG_</code> and <code>CM_</code> accept spaces and tabs after their keywords.</p>
<p>This factory handles statements inside DBC files. A separate format-level factory can be introduced when another file format is implemented. The decoder and database builders remain independent of statement dispatch.</p>
<hr />
<h1><a class="anchor" id="autotoc_md110"></a>
<h1><a class="anchor" id="autotoc_md112"></a>
Signal value descriptions (&lt;tt&gt;VAL_&lt;/tt&gt;)</h1>
<p>Signal descriptions attach text to exact raw integer values:</p>
<div class="fragment"><div class="line">BO_ 256 Status: 8 ECU</div>
@@ -813,7 +837,7 @@ if (const std::string *description = value.GetValueDescription()) {
It returns &lt;tt&gt;nullptr&lt;/tt&gt; for an invalid decode or an unknown value; numeric decoding
and &lt;tt&gt;physicalValue&lt;/tt&gt; are unchanged. A mapped empty string returns a non-null
pointer. The pointer belongs to the signal definition and stays valid while that
definition and mapping remain alive and unchanged.
definition remains alive. A decoded signal owns its immutable definition across reload.
For metadata or standalone raw values, use
&lt;tt&gt;FindValueDescription(signal.valueDescriptions, rawValue)&lt;/tt&gt;, where &lt;tt&gt;rawValue&lt;/tt&gt; is
@@ -828,7 +852,7 @@ are outside this implementation; the optional Qt adapter exposes signal mappings
&lt;hr&gt;
@section autotoc_md112 Current Limitations
@section autotoc_md114 Current Limitations
This is still a minimal implementation.
@@ -862,11 +886,11 @@ byte boundaries, and 64-bit values.
&lt;hr&gt;
@section autotoc_md114 Recommended Next Steps
@section autotoc_md116 Recommended Next Steps
A practical development order would be:
@subsection autotoc_md115 Stage 1 - already implemented
@subsection autotoc_md117 Stage 1 - already implemented
- &lt;tt&gt;BO_&lt;/tt&gt;
- &lt;tt&gt;SG_&lt;/tt&gt;
@@ -881,13 +905,13 @@ A practical development order would be:
- runtime decode database
- runtime decoder
@subsection autotoc_md116 Stage 2
@subsection autotoc_md118 Stage 2
Recommended additions:
- selective decoding of only chosen signals
@subsection autotoc_md117 Stage 3
@subsection autotoc_md119 Stage 3
Recommended additions:
@@ -897,7 +921,7 @@ Recommended additions:
- CSV export of decoded traces
- optimized filtering and signal selection
@subsection autotoc_md118 Stage 4
@subsection autotoc_md120 Stage 4
Advanced functionality:
@@ -908,7 +932,7 @@ Advanced functionality:
&lt;hr&gt;
@section autotoc_md120 Build Integration
@section autotoc_md122 Build Integration
The repository supplies qmake projects. A C++17 compiler is required; the root
build also requires Qt Core and Qt Test development packages. Other build
@@ -939,7 +963,7 @@ source lists live in &lt;tt&gt;tests/parser_tests.pri&lt;/tt&gt; and &lt;tt&gt;t
When building a consumer separately, pass
&lt;tt&gt;DBC_CORE_BUILD_DIR=/absolute/path/to/build/core&lt;/tt&gt; to qmake.
@subsection autotoc_md121 Build core without Qt libraries
@subsection autotoc_md123 Build core without Qt libraries
From the repository root:
@@ -952,7 +976,7 @@ make -j
qmake is still the build tool; this target does not link Qt libraries.
@subsection autotoc_md122 Optional Qt model adapter
@subsection autotoc_md124 Optional Qt model adapter
The adapter and its &lt;tt&gt;QAbstractItemModelTester&lt;/tt&gt; suite use Qt 6.8.2.
The adapter itself links only Qt Core.
@@ -1073,7 +1097,7 @@ Valid items are enabled and selectable, with no editing support.
<p></code></p>
<p><code>Each value-description entry contains <code>value</code> (qlonglong for negative keys, qulonglong for nonnegative keys) and <code>description</code> (QString). This preserves the full signed/unsigned 64-bit range without converting through double. An unmapped signal returns an empty list. Data comes from <code><a class="el" href="structSignalInfo.html#a43f47d0433d0cc39076bd7278b46af9c">SignalInfo::valueDescriptions</a></code>. Unsupported roles return invalid QVariant.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md123"></a>
<h2><a class="anchor" id="autotoc_md125"></a>
Standalone tree tests without Qt</h2>
<p><code></code></p>
<p><code>From the repository root, use only a C++17 compiler:</code></p>
@@ -1082,7 +1106,7 @@ Standalone tree tests without Qt</h2>
<div class="line">/tmp/dbc_tree_node_test</div>
</div><!-- fragment --><p></code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md124"></a>
<h2><a class="anchor" id="autotoc_md126"></a>
Build and run the demo</h2>
<p><code></code></p>
<p><code>After building core, run these commands from the repository root:</code></p>
@@ -1094,7 +1118,7 @@ Build and run the demo</h2>
</div><!-- fragment --><p></code></p>
<p><code>The demo prints the parsed tree and decodes eight zero bytes using the first frame definition. Replace that sample payload in <code><a class="el" href="examples_2main_8cpp.html" title="Created: 2026-03-13 Author: Deeaitch (Dim. Himro)">examples/main.cpp</a></code> to feed live CAN data or trace records.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md125"></a>
<h2><a class="anchor" id="autotoc_md127"></a>
Generate API documentation</h2>
<p><code></code></p>
<p><code>With Doxygen installed, run from the repository root:</code></p>
@@ -1104,17 +1128,17 @@ Generate API documentation</h2>
<p><code></p><hr />
<p></code></p>
<p><code></code></p>
<h1><a class="anchor" id="autotoc_md127"></a>
<h1><a class="anchor" id="autotoc_md129"></a>
Regression tests</h1>
<p><code></code></p>
<p><code>See <a class="el" href="md_tests_2README.html">tests/README.md</a> for QtTest build and execution commands. Tests cover frame validation and error locations, Intel and Motorola extraction, signal syntax and payload bounds, <code>VAL_</code> syntax and reference validation, raw description lookup and preservation through both builders, statement dispatch, signed and unsigned 64-bit boundaries, physical conversion, numeric output, and invalid signal payloads.</code></p>
<p><code></code></p>
<h1><a class="anchor" id="autotoc_md128"></a>
<h1><a class="anchor" id="autotoc_md130"></a>
Measuring code coverage</h1>
<p><code></code></p>
<p><code>Coverage instrumentation is separate from the QtTest suite named <code>CoverageTest</code>: that suite runs extra regression checks, but coverage counters require a specially instrumented build. Use a separate build directory for each coverage tool.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md129"></a>
<h2><a class="anchor" id="autotoc_md131"></a>
GCC, gcov, and LCOV on Debian/Ubuntu</h2>
<p><code></code></p>
<p><code>Install the build and report tools:</code></p>
@@ -1168,7 +1192,7 @@ GCC, gcov, and LCOV on Debian/Ubuntu</h2>
<p><code>After adding direct comment-handler and ambiguous <code>VAL_</code> reference tests, the same configuration measured 98.4% line coverage (728/740) and 71.4% branch coverage (841/1178).</code></p>
<p><code>See <a href="https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html">GCC instrumentation options</a> and the <a href="https://github.com/linux-test-project/lcov">LCOV project documentation</a>.</code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md130"></a>
<h2><a class="anchor" id="autotoc_md132"></a>
Configure the GCC coverage build in Qt Creator</h2>
<p><code></code></p>
<p><code></p><ol type="1">
@@ -1184,7 +1208,7 @@ Configure the GCC coverage build in Qt Creator</h2>
</ol>
<p></code></p>
<p><code></code></p>
<h2><a class="anchor" id="autotoc_md131"></a>
<h2><a class="anchor" id="autotoc_md133"></a>
Configure all build variants in Qt Creator</h2>
<p><code></code></p>
<p><code>The local <code>dbc.pro.user</code> stores machine-specific kit IDs and build/run settings. It is ignored by Git (<code>*.user</code>) and should not be committed or copied between machines. Recreate the configurations below through the UI when setting up a new checkout. The <code>Qt4ProjectManager</code> identifiers inside <code>.user</code> are historical Qt Creator setting names; the project still requires Qt 6.8.2.</code></p>