Skip to content

Add support for inline DWARF source files. #7932

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
merged 4 commits into from
Jan 5, 2024

Conversation

adrian-prantl
Copy link

No description provided.

JDevlieghere and others added 3 commits January 4, 2024 09:08
…71984)

This fixes a subtle and previously harmless off-by-one bug in
ParseSupportFilesFromPrologue. The function accounts for the start index
being one-based for DWARF v4 and earlier and zero-based for DWARF v5 and
later. However, the same care wasn't taken for the end index.

This bug existed unnoticed because GetFileByIndex gracefully handles an
invalid index. However, the bug manifested itself after llvm#71458, which
added a call to getFileNameEntry which requires the index to be valid.

No test as the bug cannot be observed without the changes from llvm#71458.
Once that PR is merged, this will be covered by all the DWARF v5 tests.

(cherry picked from commit fa7e07e)
There's only one use and it eventually converts the pointer into a
reference. Simplify things and always use references.

(cherry picked from commit f9632ce)
LLVM supports DWARF 5 linetable extension to store source files inline
in DWARF. This is particularly useful for compiler-generated source
code. This implementation tries to materialize them as temporary files
lazily, so SBAPI clients don't need to be aware of them.

rdar://110926168
(cherry picked from commit 917b404)

 Conflicts:
	lldb/include/lldb/Symbol/CompileUnit.h
	lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
	lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
	lldb/source/Symbol/CompileUnit.cpp
	lldb/source/Utility/FileSpecList.cpp
@adrian-prantl
Copy link
Author

@swift-ci test

There was a strange and seemingly unncessary empty string optimization
in NonRelocatableStringPool that I had to remove in order to support
empty strings in the line_str string table, without unconditionally
forcing an empty string to be added to every debug_line_str table.

(cherry picked from commit 786cf76)
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test windows

@adrian-prantl adrian-prantl merged commit 76c678c into swiftlang:stable/20230725 Jan 5, 2024
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