Reland protobuf tombstones.
This reverts the following commits:
e156ede145a7fc671c705d045d89b49922a758b5.
eda96eddcbdda9632166232b2363c7b84da0994d.
5ec54d1e843729cd1e38a2f791f001226a653e95.
1e45d3f2239333217d3252f78151f4294fda4e80.
a50f61f8fa903117a6df82d164628de310f16ae9.
Test: treehugger
Test: atest -c CtsSeccompHostTestCases:android.seccomp.cts.SeccompHostJUnit4DeviceTest#testAppZygoteSyscalls
Change-Id: Ic2b1f489ac9f1fec7d7a33c845c29891f4306bbd
diff --git a/debuggerd/proto/Android.bp b/debuggerd/proto/Android.bp
new file mode 100644
index 0000000..5307d50
--- /dev/null
+++ b/debuggerd/proto/Android.bp
@@ -0,0 +1,28 @@
+cc_library {
+ name: "libtombstone_proto",
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Wthread-safety",
+ "-Werror",
+ ],
+
+ compile_multilib: "both",
+
+ proto: {
+ export_proto_headers: true,
+ type: "lite",
+ },
+
+ srcs: [
+ "tombstone.proto",
+ ],
+
+ stl: "libc++_static",
+ apex_available: [
+ "com.android.runtime",
+ ],
+
+ recovery_available: true,
+ vendor_ramdisk_available: true,
+}
diff --git a/debuggerd/proto/tombstone.proto b/debuggerd/proto/tombstone.proto
new file mode 100644
index 0000000..aff50bd
--- /dev/null
+++ b/debuggerd/proto/tombstone.proto
@@ -0,0 +1,118 @@
+syntax = "proto3";
+
+message Tombstone {
+ Architecture arch = 1;
+ string build_fingerprint = 2;
+ string revision = 3;
+ string timestamp = 4;
+
+ uint32 pid = 5;
+ uint32 tid = 6;
+ uint32 uid = 7;
+ string selinux_label = 8;
+
+ string process_name = 9;
+
+ Signal signal_info = 10;
+ string abort_message = 14;
+ Cause cause = 15;
+
+ map<uint32, Thread> threads = 16;
+ repeated MemoryMapping memory_mappings = 17;
+ repeated LogBuffer log_buffers = 18;
+ repeated FD open_fds = 19;
+}
+
+enum Architecture {
+ ARM32 = 0;
+ ARM64 = 1;
+ X86 = 2;
+ X86_64 = 3;
+}
+
+message Signal {
+ int32 number = 1;
+ string name = 2;
+
+ int32 code = 3;
+ string code_name = 4;
+
+ bool has_sender = 5;
+ int32 sender_uid = 6;
+ int32 sender_pid = 7;
+
+ bool has_fault_address = 8;
+ uint64 fault_address = 9;
+}
+
+message Cause {
+ string human_readable = 1;
+}
+
+message Register {
+ string name = 1;
+ uint64 u64 = 2;
+}
+
+message Thread {
+ int32 id = 1;
+ string name = 2;
+ repeated Register registers = 3;
+ repeated BacktraceFrame current_backtrace = 4;
+ repeated MemoryDump memory_dump = 5;
+}
+
+message BacktraceFrame {
+ uint64 rel_pc = 1;
+ uint64 pc = 2;
+ uint64 sp = 3;
+
+ string function_name = 4;
+ uint64 function_offset = 5;
+
+ string file_name = 6;
+ uint64 file_map_offset = 7;
+ string build_id = 8;
+}
+
+message MemoryDump {
+ string register_name = 1;
+ string mapping_name = 2;
+ uint64 begin_address = 3;
+ bytes memory = 4;
+}
+
+message MemoryMapping {
+ uint64 begin_address = 1;
+ uint64 end_address = 2;
+ uint64 offset = 3;
+
+ bool read = 4;
+ bool write = 5;
+ bool execute = 6;
+
+ string mapping_name = 7;
+ string build_id = 8;
+ uint64 load_bias = 9;
+}
+
+message FD {
+ int32 fd = 1;
+ string path = 2;
+ string owner = 3;
+ uint64 tag = 4;
+}
+
+message LogBuffer {
+ string name = 1;
+ repeated LogMessage logs = 2;
+}
+
+message LogMessage {
+ string timestamp = 1;
+ uint32 pid = 2;
+ uint32 tid = 3;
+ uint32 priority = 4;
+ string tag = 5;
+ string message = 6;
+}