Add .gnu_debugdata support.

Update the unwind_info tool to dump all of the sections.

Bug: 23762183

Test: Passes new unit tests.
Change-Id: I8b223bc208a1a2ef06ed333e6d96943c8f273681
diff --git a/libunwindstack/Android.bp b/libunwindstack/Android.bp
index d7e949b..31837a2 100644
--- a/libunwindstack/Android.bp
+++ b/libunwindstack/Android.bp
@@ -57,16 +57,17 @@
         "ElfInterface.cpp",
         "ElfInterfaceArm.cpp",
         "Log.cpp",
-        "Regs.cpp",
         "MapInfo.cpp",
         "Maps.cpp",
         "Memory.cpp",
+        "Regs.cpp",
         "Symbols.cpp",
     ],
 
     shared_libs: [
         "libbase",
         "liblog",
+        "liblzma",
     ],
 }
 
@@ -128,6 +129,7 @@
     shared_libs: [
         "libbase",
         "liblog",
+        "liblzma",
     ],
 
     static_libs: [
@@ -151,6 +153,11 @@
     shared_libs: [
         "libunwindstack",
     ],
+
+    data: [
+        "tests/elf32.xz",
+        "tests/elf64.xz",
+    ],
 }
 
 // These unit tests run against the static debug library.
@@ -161,6 +168,11 @@
     static_libs: [
         "libunwindstack_debug",
     ],
+
+    data: [
+        "tests/elf32.xz",
+        "tests/elf64.xz",
+    ],
 }
 
 //-------------------------------------------------------------------------
@@ -173,6 +185,7 @@
     shared_libs: [
         "libunwindstack",
         "libbase",
+        "liblzma",
     ],
 
     static_libs: [
@@ -190,3 +203,19 @@
         "unwind_info.cpp",
     ],
 }
+
+// Generates the elf data for use in the tests for .gnu_debugdata frames.
+// Once these files are generated, use the xz command to compress the data.
+cc_binary_host {
+    name: "gen_gnudebugdata",
+
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wextra",
+    ],
+
+    srcs: [
+        "tests/GenGnuDebugdata.cpp",
+    ],
+}