[PATCH] D87275: [obj2yaml] Test generating and dumping a broken debug_ranges section.

Xing GUO via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 01:34:29 PDT 2020


Higuoxing created this revision.
Higuoxing added reviewers: jhenderson, grimar, MaskRay.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Higuoxing requested review of this revision.

This patch tests generating and dumping a broken debug_ranges section.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87275

Files:
  llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml


Index: llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml
===================================================================
--- llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml
+++ llvm/test/ObjectYAML/MachO/DWARF-debug_ranges.yaml
@@ -284,3 +284,26 @@
         reserved2: 0x00000000
         reserved3: 0x00000000
         content:   [[CONTENT=<none>]]
+
+## Test generating and dumping a __debug_ranges section whose size isn't a multiple of address size.
+## This test case is to ensure that when the parser fails, the content of the __debug_ranges section
+## will be dumped into the 'content' entry and the 'debug_ranges' entry will not exist.
+
+# RUN: yaml2obj --docnum=2 -DSIZE=3 -DCONTENT='010203' %s | obj2yaml | FileCheck %s --check-prefix=FAILS
+
+#  FAILS-NOT: DWARF:
+#      FAILS: Sections:
+# FAILS-NEXT:   - sectname:  __debug_ranges
+# FAILS-NEXT:     segname:   __DWARF
+# FAILS-NEXT:     addr:      0x0000000000000000
+# FAILS-NEXT:     size:      3
+# FAILS-NEXT:     offset:    0x00000210
+# FAILS-NEXT:     align:     0
+# FAILS-NEXT:     reloff:    0x00000000
+# FAILS-NEXT:     nreloc:    0
+# FAILS-NEXT:     flags:     0x00000000
+# FAILS-NEXT:     reserved1: 0x00000000
+# FAILS-NEXT:     reserved2: 0x00000000
+# FAILS-NEXT:     reserved3: 0x00000000
+# FAILS-NEXT:     content:   '010203'
+# FAILS-NEXT: ...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87275.290430.patch
Type: text/x-patch
Size: 1342 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200908/02406076/attachment.bin>


More information about the llvm-commits mailing list