crash_dump: fix warnings, turn on -Werror.
Test: mma
Change-Id: I0722fef7b513be976cbbe89f73e8bb7138a80442
diff --git a/debuggerd/Android.bp b/debuggerd/Android.bp
index af84be9..b385ea5 100644
--- a/debuggerd/Android.bp
+++ b/debuggerd/Android.bp
@@ -3,7 +3,7 @@
cflags: [
"-Wall",
"-Wextra",
- "-Wno-error",
+ "-Werror",
"-Wno-nullability-completeness",
"-Os",
],
diff --git a/debuggerd/crash_dump.cpp b/debuggerd/crash_dump.cpp
index 57a6c44..38b711f 100644
--- a/debuggerd/crash_dump.cpp
+++ b/debuggerd/crash_dump.cpp
@@ -199,10 +199,6 @@
pid_t main_tid;
pid_t pseudothread_tid;
- if (target == 1) {
- LOG(FATAL) << "target died before we could attach (received main tid = " << main_tid << ")";
- }
-
if (!android::base::ParseInt(argv[1], &main_tid, 1, std::numeric_limits<pid_t>::max())) {
LOG(FATAL) << "invalid main tid: " << argv[1];
}
@@ -211,6 +207,10 @@
LOG(FATAL) << "invalid pseudothread tid: " << argv[2];
}
+ if (target == 1) {
+ LOG(FATAL) << "target died before we could attach (received main tid = " << main_tid << ")";
+ }
+
android::procinfo::ProcessInfo target_info;
if (!android::procinfo::GetProcessInfo(main_tid, &target_info)) {
LOG(FATAL) << "failed to fetch process info for target " << main_tid;
diff --git a/debuggerd/libdebuggerd/include/tombstone.h b/debuggerd/libdebuggerd/include/tombstone.h
index 8e60278..d2a4a4b 100644
--- a/debuggerd/libdebuggerd/include/tombstone.h
+++ b/debuggerd/libdebuggerd/include/tombstone.h
@@ -43,6 +43,7 @@
ucontext_t* ucontext);
// Compatibility shim.
+__attribute__((__unused__))
static void engrave_tombstone_ucontext(int tombstone_fd, pid_t, pid_t, uintptr_t abort_msg_address,
siginfo_t* siginfo, ucontext_t* ucontext) {
engrave_tombstone_ucontext(tombstone_fd, abort_msg_address, siginfo, ucontext);