summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-07-25 23:01:38 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-07-25 23:01:38 +0000
commit743d351120e98df6bc4a1e411174c2c2daf8779c (patch)
tree6edb56ca84ba1174802c9465fac75bc578c16034 /llvm/test/tools
parent9d1bcc2a8887d3965d8b071eceb88f0f2eab53a2 (diff)
downloadbcm5719-llvm-743d351120e98df6bc4a1e411174c2c2daf8779c.tar.gz
bcm5719-llvm-743d351120e98df6bc4a1e411174c2c2daf8779c.zip
[dsymutil] Add support for generating DWARF5 accelerator tables.
This patch add support for emitting DWARF5 accelerator tables (.debug_names) from dsymutil. Just as with the Apple style accelerator tables, it's possible to update existing dSYMs. This patch includes a test that show how you can convert back and forth between the two types. If no kind of table is specified, dsymutil will default to generating Apple-style accelerator tables whenever it finds those in its input. The same is true when there are no accelerator tables at all. Finally, in the remaining case, where there's at least one DWARF v5 table and no Apple ones, the output will contains a DWARF accelerator tables (.debug_names). Differential revision: https://reviews.llvm.org/D49137 llvm-svn: 337980
Diffstat (limited to 'llvm/test/tools')
-rw-r--r--llvm/test/tools/dsymutil/X86/accelerator.test38
-rw-r--r--llvm/test/tools/dsymutil/cmdline.test1
2 files changed, 39 insertions, 0 deletions
diff --git a/llvm/test/tools/dsymutil/X86/accelerator.test b/llvm/test/tools/dsymutil/X86/accelerator.test
new file mode 100644
index 00000000000..6ebef5dcf8c
--- /dev/null
+++ b/llvm/test/tools/dsymutil/X86/accelerator.test
@@ -0,0 +1,38 @@
+RUN: dsymutil -accelerator=Dwarf -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 -o %t.dwarf.dSYM
+RUN: dsymutil -accelerator=Apple -oso-prepend-path=%p/.. %p/../Inputs/basic.macho.x86_64 -o %t.apple.dSYM
+
+RUN: llvm-dwarfdump -verify %t.dwarf.dSYM
+RUN: llvm-dwarfdump -verify %t.apple.dSYM
+
+RUN: llvm-dwarfdump -debug-names %t.dwarf.dSYM | FileCheck %s -check-prefix=NAMES -check-prefix=DWARF
+RUN: llvm-dwarfdump -apple-names -apple-namespaces -apple-types %t.apple.dSYM | FileCheck %s -check-prefix=NAMES -check-prefix=APPLE
+
+RUN: dsymutil -update -accelerator=Dwarf %t.apple.dSYM -o %t.dwarf.updated.dSYM
+RUN: dsymutil -update -accelerator=Apple %t.dwarf.dSYM -o %t.apple.updated.dSYM
+
+RUN: llvm-dwarfdump -verify %t.dwarf.updated.dSYM
+RUN: llvm-dwarfdump -verify %t.apple.updated.dSYM
+
+RUN: llvm-dwarfdump -debug-names %t.dwarf.updated.dSYM | FileCheck %s -check-prefix=NAMES -check-prefix=DWARF
+RUN: llvm-dwarfdump -apple-names -apple-namespaces -apple-types %t.apple.updated.dSYM | FileCheck %s -check-prefix=NAMES -check-prefix=APPLE
+
+DWARF: .debug_names contents:
+DWARF: Compilation Unit offsets [
+DWARF: CU[0]
+DWARF: CU[1]
+DWARF: CU[2]
+DWARF: ]
+
+APPLE-DAG: .apple_names contents:
+APPLE-DAG: .apple_types contents:
+APPLE-DAG: .apple_namespaces contents:
+
+NAMES-DAG: "private_int"
+NAMES-DAG: "baz"
+NAMES-DAG: "int"
+NAMES-DAG: "bar"
+NAMES-DAG: "foo"
+NAMES-DAG: "inc"
+NAMES-DAG: "val"
+NAMES-DAG: "main"
+NAMES-DAG: "char"
diff --git a/llvm/test/tools/dsymutil/cmdline.test b/llvm/test/tools/dsymutil/cmdline.test
index e010169b20e..c2ddead320a 100644
--- a/llvm/test/tools/dsymutil/cmdline.test
+++ b/llvm/test/tools/dsymutil/cmdline.test
@@ -5,6 +5,7 @@ HELP-NOT: -reverse-iterate
HELP: Color Options
HELP: -color
HELP: Specific Options:
+HELP: -accelerator
HELP: -arch=<arch>
HELP: -dump-debug-map
HELP: -flat
OpenPOWER on IntegriCloud