Skip to content

[Debug info] Dump macro expansion buffers to disk for debug info to reference #63125

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

Merged

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jan 20, 2023

When emitting debug info that references into a macro expansion, dump
the macro expansion buffer into a file on disk (in the temporary
directory) so that one can see the macro expansion buffers in the
source files themselves.

And thanks to the @adrian-prantl, emit "inline call" debug scopes for macro expansion expressions. The end result of this is that LLDB can "step into" a macro expansion expression to walk through the expanded code.

Implements a big chunk of rdar://102916513.

…eference

When emitting debug info that references into a macro expansion, dump
the macro expansion buffer into a file on disk (in the temporary
directory) so that one can see the macro expansion buffers in the
source files themselves.

The test here validates that the generated LLVM IR looks correct, but
I'm having a problem getting LLDB to actually locate the source code
correctly.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

DougGregor and others added 4 commits January 20, 2023 21:35
When there are no excerpts, we should assume indentation of zero.
This allows the debugger to choose whether to display the expanded macro
(inlined) or the original source code (parent frame).

rdar://102916513
…en to disk.

This helps LLDB recognize the last line of the macro.
@DougGregor DougGregor marked this pull request as ready for review January 21, 2023 05:54
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

Note that the actual debug-info scope code is from #63144.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit d192bfc into swiftlang:main Jan 21, 2023
@DougGregor DougGregor deleted the debug-info-dump-macro-expansion-buffers branch January 21, 2023 15:44
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