[llvm] c2216d7 - [AMDGPU] Print metadata on error
Sebastian Neubauer via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 08:22:15 PDT 2020
Author: Sebastian Neubauer
Date: 2020-10-12T17:22:06+02:00
New Revision: c2216d796aab7659771c05303f9d78bad4aeca07
URL: https://github.com/llvm/llvm-project/commit/c2216d796aab7659771c05303f9d78bad4aeca07
DIFF: https://github.com/llvm/llvm-project/commit/c2216d796aab7659771c05303f9d78bad4aeca07.diff
LOG: [AMDGPU] Print metadata on error
If the metadata is valid yaml, we can print it, even if it failed
validation. That makes it easier to debug any wrong metadata.
Differential Revision: https://reviews.llvm.org/D89243
Added:
Modified:
llvm/tools/llvm-readobj/ELFDumper.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index e7ee0793b903..fcc5c002c624 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -5108,10 +5108,10 @@ static AMDGPUNote getAMDGPUNote(uint32_t NoteType, ArrayRef<uint8_t> Desc) {
return {"AMDGPU Metadata", "Invalid AMDGPU Metadata"};
AMDGPU::HSAMD::V3::MetadataVerifier Verifier(true);
+ std::string HSAMetadataString;
if (!Verifier.verify(MsgPackDoc.getRoot()))
- return {"AMDGPU Metadata", "Invalid AMDGPU Metadata"};
+ HSAMetadataString = "Invalid AMDGPU Metadata\n";
- std::string HSAMetadataString;
raw_string_ostream StrOS(HSAMetadataString);
MsgPackDoc.toYAML(StrOS);
More information about the llvm-commits
mailing list