aboutsummaryrefslogtreecommitdiff
path: root/src/debug/dwarf/testdata
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2015-03-06 13:26:04 -0500
committerAustin Clements <austin@google.com>2015-03-10 02:32:48 +0000
commitfdd49d2be02fa62ecbf547e4224663b562077425 (patch)
tree278f9f6a674c09409a6259c72afd09b2de6e2b70 /src/debug/dwarf/testdata
parent339300926774c9e4868a04d1362c98b19706c7d1 (diff)
downloadgo-fdd49d2be02fa62ecbf547e4224663b562077425.tar.xz
debug/dwarf: add unit tests for line table reader
This adds simple ELF test binaries generated by gcc and clang and compares the line tables returned by the line table reader against tables based on the output of readelf. The binaries were generated with # gcc --version | head -n1 gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2 # gcc -g -o line-gcc.elf line*.c # clang --version | head -n1 Ubuntu clang version 3.4-1ubuntu3 (tags/RELEASE_34/final) (based on LLVM 3.4) # clang -g -o line-clang.elf line*.c Change-Id: Id210fdc1d007ac9719e8f5dc845f2b94eed12234 Reviewed-on: https://go-review.googlesource.com/7070 Reviewed-by: Nigel Tao <nigeltao@golang.org> Reviewed-by: Rob Pike <r@golang.org>
Diffstat (limited to 'src/debug/dwarf/testdata')
-rwxr-xr-xsrc/debug/dwarf/testdata/line-clang.elfbin0 -> 10271 bytes
-rwxr-xr-xsrc/debug/dwarf/testdata/line-gcc.elfbin0 -> 10113 bytes
-rw-r--r--src/debug/dwarf/testdata/line1.c9
-rw-r--r--src/debug/dwarf/testdata/line1.h7
-rw-r--r--src/debug/dwarf/testdata/line2.c6
5 files changed, 22 insertions, 0 deletions
diff --git a/src/debug/dwarf/testdata/line-clang.elf b/src/debug/dwarf/testdata/line-clang.elf
new file mode 100755
index 0000000000..b63cc781c4
--- /dev/null
+++ b/src/debug/dwarf/testdata/line-clang.elf
Binary files differ
diff --git a/src/debug/dwarf/testdata/line-gcc.elf b/src/debug/dwarf/testdata/line-gcc.elf
new file mode 100755
index 0000000000..50500a8eec
--- /dev/null
+++ b/src/debug/dwarf/testdata/line-gcc.elf
Binary files differ
diff --git a/src/debug/dwarf/testdata/line1.c b/src/debug/dwarf/testdata/line1.c
new file mode 100644
index 0000000000..f35864776c
--- /dev/null
+++ b/src/debug/dwarf/testdata/line1.c
@@ -0,0 +1,9 @@
+#include "line1.h"
+
+void f2();
+
+int main()
+{
+ f1();
+ f2();
+}
diff --git a/src/debug/dwarf/testdata/line1.h b/src/debug/dwarf/testdata/line1.h
new file mode 100644
index 0000000000..974d4c8817
--- /dev/null
+++ b/src/debug/dwarf/testdata/line1.h
@@ -0,0 +1,7 @@
+static void f1()
+{
+ char buf[10];
+ int i;
+ for(i = 0; i < 10; i++)
+ buf[i] = 1;
+}
diff --git a/src/debug/dwarf/testdata/line2.c b/src/debug/dwarf/testdata/line2.c
new file mode 100644
index 0000000000..38d89983cb
--- /dev/null
+++ b/src/debug/dwarf/testdata/line2.c
@@ -0,0 +1,6 @@
+#include <stdio.h>
+
+void f2()
+{
+ printf("hello\n");
+}