Add -Z embed-source=yes
to embed source code in DWARF debug info
This commit is contained in:
parent
80d8270d84
commit
0b87af9d4f
9 changed files with 76 additions and 4 deletions
|
@ -901,14 +901,19 @@ extern "C" LLVMMetadataRef
|
|||
LLVMRustDIBuilderCreateFile(LLVMRustDIBuilderRef Builder, const char *Filename,
|
||||
size_t FilenameLen, const char *Directory,
|
||||
size_t DirectoryLen, LLVMRustChecksumKind CSKind,
|
||||
const char *Checksum, size_t ChecksumLen) {
|
||||
const char *Checksum, size_t ChecksumLen,
|
||||
const char *Source, size_t SourceLen) {
|
||||
|
||||
std::optional<DIFile::ChecksumKind> llvmCSKind = fromRust(CSKind);
|
||||
std::optional<DIFile::ChecksumInfo<StringRef>> CSInfo{};
|
||||
if (llvmCSKind)
|
||||
CSInfo.emplace(*llvmCSKind, StringRef{Checksum, ChecksumLen});
|
||||
std::optional<StringRef> oSource{};
|
||||
if (Source)
|
||||
oSource = StringRef(Source, SourceLen);
|
||||
return wrap(Builder->createFile(StringRef(Filename, FilenameLen),
|
||||
StringRef(Directory, DirectoryLen), CSInfo));
|
||||
StringRef(Directory, DirectoryLen), CSInfo,
|
||||
oSource));
|
||||
}
|
||||
|
||||
extern "C" LLVMMetadataRef
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue