Skip to content

feat: add dbg! macro to wdk#610

Open
Alan632 wants to merge 2 commits intomicrosoft:mainfrom
Alan632:dbg_macro
Open

feat: add dbg! macro to wdk#610
Alan632 wants to merge 2 commits intomicrosoft:mainfrom
Alan632:dbg_macro

Conversation

@Alan632
Copy link

@Alan632 Alan632 commented Feb 10, 2026

This PR adds a no_std implementation of the dbg! macro to wdk.

Refer to the macro dbg! for the std crate's dbg! details.

@Alan632
Copy link
Author

Alan632 commented Feb 10, 2026

@microsoft-github-policy-service agree company="Microsoft"

@Alan632 Alan632 marked this pull request as ready for review February 10, 2026 22:08
@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.41%. Comparing base (4895c2d) to head (8aefb3d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #610   +/-   ##
=======================================
  Coverage   77.41%   77.41%           
=======================================
  Files          24       24           
  Lines        4853     4853           
  Branches     4853     4853           
=======================================
  Hits         3757     3757           
  Misses        979      979           
  Partials      117      117           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@wmmc88 wmmc88 requested a review from a team February 10, 2026 23:45
@Alan632 Alan632 self-assigned this Feb 11, 2026
Copilot AI review requested due to automatic review settings February 11, 2026 18:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a no_std-friendly dbg! macro to the wdk crate to support quick debugging output routed through the existing debugger-backed println! infrastructure.

Changes:

  • Introduces dbg! as a #[macro_export] macro mirroring std::dbg! behavior (print + return value).
  • Adds platform-specific documentation for the new macro (WDM/KMDF via DbgPrint, UMDF via OutputDebugStringA).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Alan632
Copy link
Author

Alan632 commented Feb 12, 2026

Quick verification test using the sample kmdf example in windows-drivers-rs.

behavior in DebugView:
image_1770864083904_0

std environment behavior:
image_1770864158715_0

@Alan632 Alan632 added this pull request to the merge queue Feb 12, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 12, 2026
@gurry gurry added this pull request to the merge queue Feb 13, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 13, 2026
Co-authored-by: Alan Ngo (from Dev Box) <ngoalan@microsoft.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2026
@Alan632 Alan632 added this pull request to the merge queue Feb 13, 2026
github-merge-queue bot pushed a commit that referenced this pull request Feb 13, 2026
Co-authored-by: Alan Ngo (from Dev Box) <ngoalan@microsoft.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2026
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.

6 participants