Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send debug messages to Windows debugger #78838

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

alef
Copy link
Contributor

@alef alef commented Dec 29, 2024

Summary

Infrastructure "Send debug messages to Windows debugger"

Purpose of change

In addition to debug.log, send all debug messages to Windows debugger via OutputDebugStringA.

Describe the solution

Add a wrapper class to intercept streambuf methods. This will make possible to grow a string and flush to OutputDebugStringA later.

Not required, but also:

  • changed PATH_INFO::debug to a cata_path, like others
  • changed DebugFile interface
  • flush/sync debug.log now and then

Describe alternatives you've considered

None

Testing

  • ✔ vscode: CMake MSVC build and launch.json with a debugger
  • ✔ vscode: CMake MSVC build and run from terminal with Sysinternal's Dbgview
  • regressions ?
  • MSYS2/MINGw ?

Additional context

PR in draft because of some ideas want to work on later but still get some feedback.

image

image

alef added 2 commits December 29, 2024 17:38
DebugFile hosts the ostream as a singleton. This is fine because
debugFile() does the same.
Maybe move it into DebugFile::init to capture the start.
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style json-styled JSON lint passed, label assigned by github actions labels Dec 29, 2024
@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 29, 2024
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Dec 31, 2024
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant