[lldb] [llvm] [Obj2Yaml] Add support for minidump generation with 64b memory ranges. (PR #101272)
    Pavel Labath via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Thu Aug  8 01:08:35 PDT 2024
    
    
  
================
@@ -336,3 +336,88 @@ TEST(MinidumpYAML, ExceptionStream_ExtraParameter) {
                                0xab, 0xad, 0xca, 0xfe}),
             *ExpectedContext);
 }
+
+TEST(MinidumpYAML, MemoryRegion_64bit) {
+  SmallString<0> Storage;
+  auto ExpectedFile = toBinary(Storage, R"(
+--- !minidump
+Streams:
+  - Type:            Memory64List
+    Memory Ranges:
+      - Start of Memory Range: 0x7FFFFFCF0818283
+        Content:               '68656c6c6f'
+      - Start of Memory Range: 0x7FFFFFFF0818283
+        Content:               '776f726c64'
+        )");
+
+  ASSERT_THAT_EXPECTED(ExpectedFile, Succeeded());
+  object::MinidumpFile &File = **ExpectedFile;
+
+  ASSERT_THAT(File.streams().size(), 1u);
+
+  Error Err = Error::success();
+  // Explicit Err check
+  ASSERT_FALSE(Err);
----------------
labath wrote:
This shouldn't be necessary. Could it have something to do with the fact that you're not using the `ErrorAsOutParameter` object inside `getMemory64List`? (That object allows you to assign to an error object without first checking it).
https://github.com/llvm/llvm-project/pull/101272
    
    
More information about the llvm-commits
mailing list