[PATCH] D89243: [AMDGPU] Print metadata on error
Sebastian Neubauer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 08:02:32 PDT 2020
Flakebi created this revision.
Flakebi added a reviewer: arsenm.
Herald added subscribers: llvm-commits, rupprecht, t-tye, tpr, dstuttard, yaxunl, kzhuravl.
Herald added a reviewer: jhenderson.
Herald added a project: LLVM.
Flakebi requested review of this revision.
Herald added subscribers: MaskRay, wdng.
If the metadata is valid yaml, we can print it, even if it failed
validation. That makes it easier to debug any wrong metadata.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89243
Files:
llvm/tools/llvm-readobj/ELFDumper.cpp
Index: llvm/tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- llvm/tools/llvm-readobj/ELFDumper.cpp
+++ llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -5045,10 +5045,10 @@
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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89243.297593.patch
Type: text/x-patch
Size: 666 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201012/d84b9213/attachment.bin>
More information about the llvm-commits
mailing list