[libcore][debug-info] Add a test for StackTraceElement data

Add explicit test coverage to ensure that StackTraceElement data
corresponds to the debug data encoded in the owning dex file. We use
smali source to have full control over the generated dex file we use as
a test fixture.

Test cases added include methods with & without any line information.

In the future we can fix and test the DBG_SET_FILE opcode which is
currently not respected / following the dex-format specification.

Test: atest CtsLibcoreTestCases:libcore.java.lang.ThreadTest

Change-Id: I7adb3d71b86af03a3cd49dcc46bcb825be38f54b
Signed-off-by: Dan Zimmerman <danzimm@fb.com>
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index 1ee62f8..3fe1030 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -563,6 +563,14 @@
     visibility: ["//libcore/luni/src/test/java9language"],
 }
 
+genrule {
+    name: "core-tests-smali-dex",
+    srcs: ["luni/src/test/java/**/*.smali"],
+    cmd: "$(location smali) ass --api 28 -o $(out) $(in)",
+    out: ["core-tests-smali.dex"],
+    tools: ["smali"],
+}
+
 // Builds the core-tests library.
 java_test {
     name: "core-tests",
@@ -599,6 +607,7 @@
         ":annotations-test",
         ":filesystemstest",
         ":parameter-metadata-test",
+        ":core-tests-smali-dex",
     ],
 
     sdk_version: "none",