Skip to content

Conversation

Copy link

Copilot AI commented Nov 22, 2025

dtdoctor only recognized ordinal-based device symbols (__device_dts_ord_<N>), failing to diagnose errors when CONFIG_LLEXT_EXPORT_DEV_IDS_BY_HASH generates hash-based symbols (__device_dts_<HASH>).

Changes

  • dtdoctor_sca_wrapper.py: Added regex patterns to capture hash-based symbols from gcc, ld, LLVM/clang, and LLVM/lld error messages. Used negative lookahead (?!ord_) to distinguish from ordinal symbols.

  • dtdoctor_analyzer.py: Extended symbol parsing to handle both formats. Node lookup now attempts ordinal match first, then falls back to hash-based lookup using the Node.hash attribute.

  • dtdoctor.rst: Updated to mention both symbol types.

Example

Both symbol types are now supported:

# Ordinal-based (default)
./scripts/dts/dtdoctor_analyzer.py --edt-pickle build/zephyr/edt.pickle \
    --symbol __device_dts_ord_123

# Hash-based (LLEXT builds)
./scripts/dts/dtdoctor_analyzer.py --edt-pickle build/zephyr/edt.pickle \
    --symbol __device_dts_a1b2c3d4
Original prompt

improve dtdoctor so that it is able to troubleshoot errors with more types of macros


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Enhance DTDDoctor to troubleshoot more macro error types dtdoctor: Add support for hash-based device symbols Nov 22, 2025
Copilot finished work on behalf of kartben November 22, 2025 16:34
Copilot AI requested a review from kartben November 22, 2025 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants