Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1a8dfa0 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

debuggerd: turn on -Werror

- Deal with some -Wunused / -Wunused-variable issues

Change-Id: I39849fe30170f69d1cab7d4ad2629b3a49e14ee7
parent b149e245
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -20,8 +20,7 @@ LOCAL_CPPFLAGS := -std=gnu++11
LOCAL_CFLAGS := \
	-Wall \
	-Wno-array-bounds \
	-Werror \
	-Wno-unused-parameter \
	-Werror

ifeq ($(ARCH_ARM_HAVE_VFP),true)
LOCAL_CFLAGS_arm += -DWITH_VFP
@@ -55,7 +54,7 @@ LOCAL_SRC_FILES_x86 := x86/crashglue.S
LOCAL_SRC_FILES_x86_64 := x86_64/crashglue.S
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS += -fstack-protector-all -Wno-unused-parameter -Wno-free-nonheap-object
LOCAL_CFLAGS += -fstack-protector-all -Werror -Wno-free-nonheap-object
#LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_SHARED_LIBRARIES := libcutils liblog libc

@@ -76,6 +75,7 @@ ifeq ($(ARCH_ARM_HAVE_VFP_D32),true)
LOCAL_CFLAGS_arm += -DWITH_VFP_D32
endif # ARCH_ARM_HAVE_VFP_D32
endif # ARCH_ARM_HAVE_VFP == true
LOCAL_CFLAGS += -Werror

LOCAL_SRC_FILES_arm64 := arm64/vfp.S
LOCAL_MODULE_TARGET_ARCH += arm64
+0 −2
Original line number Diff line number Diff line
@@ -82,8 +82,6 @@ void dump_registers(log_t* log, pid_t tid, int scope_flags)
  io.iov_base = &r;
  io.iov_len = sizeof(r);

  bool only_in_tombstone = !IS_AT_FAULT(scope_flags);

  if (ptrace(PTRACE_GETREGSET, tid, (void*) NT_PRSTATUS, (void*) &io) == -1) {
    _LOG(log, scope_flags, "ptrace error: %s\n", strerror(errno));
    return;
+7 −7
Original line number Diff line number Diff line
@@ -6,13 +6,18 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/cdefs.h>
#include <sys/ptrace.h>
#include <sys/socket.h>
#include <sys/wait.h>
#include <unistd.h>

#include <cutils/log.h>
#include <cutils/sockets.h>
#include <log/log.h>

#ifndef __unused
#define __unused __attribute__((__unused__))
#endif

extern const char* __progname;

@@ -26,7 +31,7 @@ static void maybe_abort() {
    }
}

static int smash_stack(int i) {
static int smash_stack(int i __unused) {
    printf("crasher: deliberately corrupting stack...\n");
    // Unless there's a "big enough" buffer on the stack, gcc
    // doesn't bother inserting checks.
@@ -47,11 +52,6 @@ __attribute__((noinline)) static void overflow_stack(void* p) {
    overflow_stack(&buf);
}

static void test_call1()
{
    *((int*) 32) = 1;
}

static void *noisy(void *x)
{
    char c = (uintptr_t) x;