Loading adb/Android.mk +3 −3 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ LOCAL_LDFLAGS_windows := -municode LOCAL_LDLIBS_linux := -lrt -ldl -lpthread LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc LOCAL_LDLIBS_windows := -lws2_32 -luserenv LOCAL_STATIC_LIBRARIES_windows := AdbWinApi LOCAL_SHARED_LIBRARIES_windows := AdbWinApi LOCAL_MULTILIB := first Loading @@ -254,8 +254,8 @@ LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -fra # Use wmain instead of main LOCAL_LDFLAGS_windows := -municode LOCAL_LDLIBS_windows := -lws2_32 -lgdi32 LOCAL_STATIC_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi LOCAL_SHARED_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi LOCAL_SRC_FILES := \ adb_client.cpp \ Loading base/include/android-base/stringprintf.h +7 −7 Original line number Diff line number Diff line Loading @@ -28,27 +28,27 @@ namespace base { // if the mingw version of vsnprintf is used, use `gnu_printf' which allows z // in %zd and PRIu64 (and related) to be recognized by the compile-time // checking. #define FORMAT_ARCHETYPE __printf__ #define ANDROID_BASE_FORMAT_ARCHETYPE __printf__ #ifdef __USE_MINGW_ANSI_STDIO #if __USE_MINGW_ANSI_STDIO #undef FORMAT_ARCHETYPE #define FORMAT_ARCHETYPE gnu_printf #undef ANDROID_BASE_FORMAT_ARCHETYPE #define ANDROID_BASE_FORMAT_ARCHETYPE gnu_printf #endif #endif // Returns a string corresponding to printf-like formatting of the arguments. std::string StringPrintf(const char* fmt, ...) __attribute__((__format__(FORMAT_ARCHETYPE, 1, 2))); __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 1, 2))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendF(std::string* dst, const char* fmt, ...) __attribute__((__format__(FORMAT_ARCHETYPE, 2, 3))); __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 3))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendV(std::string* dst, const char* format, va_list ap) __attribute__((__format__(FORMAT_ARCHETYPE, 2, 0))); __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 0))); #undef FORMAT_ARCHETYPE #undef ANDROID_BASE_FORMAT_ARCHETYPE } // namespace base } // namespace android Loading bootstat/bootstat.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,15 @@ const std::map<std::string, int32_t> kBootReasonMap = { {"reboot_rtc", 132}, {"cold_boot", 133}, {"hard_rst", 134}, {"power-on", 135}, {"oem_adsp_resetting_the_soc", 136}, {"kpdpwr", 137}, {"oem_modem_timeout_waiting", 138}, {"usb_chg", 139}, {"warm_reset_0x02", 140}, {"warm_reset_0x80", 141}, {"pon_reason_0xb0", 142}, {"reboot_download", 143}, }; // Converts a string value representing the reason the system booted to an Loading debuggerd/handler/debuggerd_handler.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,17 @@ static void debuggerd_signal_handler(int signal_number, siginfo_t* info, void* c fatal_errno("failed to set dumpable"); } // On kernels with yama_ptrace enabled, also allow any process to attach. bool restore_orig_ptracer = true; if (prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY) != 0) { if (errno == EINVAL) { // This kernel does not support PR_SET_PTRACER_ANY, or Yama is not enabled. restore_orig_ptracer = false; } else { fatal_errno("failed to set traceable"); } } // Essentially pthread_create without CLONE_FILES, so we still work during file descriptor // exhaustion. pid_t child_pid = Loading @@ -521,6 +532,11 @@ static void debuggerd_signal_handler(int signal_number, siginfo_t* info, void* c fatal_errno("failed to restore dumpable"); } // Restore PR_SET_PTRACER to its original value. if (restore_orig_ptracer && prctl(PR_SET_PTRACER, 0) != 0) { fatal_errno("failed to restore traceable"); } if (info->si_signo == DEBUGGER_SIGNAL) { // If the signal is fatal, don't unlock the mutex to prevent other crashing threads from // starting to dump right before our death. Loading fastboot/Android.mk +2 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -fra LOCAL_CFLAGS_darwin := -Wno-unused-parameter LOCAL_SRC_FILES_windows := usb_windows.cpp LOCAL_STATIC_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi LOCAL_SHARED_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi LOCAL_LDLIBS_windows := -lws2_32 LOCAL_C_INCLUDES_windows := development/host/windows/usb/api Loading Loading
adb/Android.mk +3 −3 Original line number Diff line number Diff line Loading @@ -237,7 +237,7 @@ LOCAL_LDFLAGS_windows := -municode LOCAL_LDLIBS_linux := -lrt -ldl -lpthread LOCAL_LDLIBS_darwin := -framework CoreFoundation -framework IOKit -lobjc LOCAL_LDLIBS_windows := -lws2_32 -luserenv LOCAL_STATIC_LIBRARIES_windows := AdbWinApi LOCAL_SHARED_LIBRARIES_windows := AdbWinApi LOCAL_MULTILIB := first Loading @@ -254,8 +254,8 @@ LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -fra # Use wmain instead of main LOCAL_LDFLAGS_windows := -municode LOCAL_LDLIBS_windows := -lws2_32 -lgdi32 LOCAL_STATIC_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi LOCAL_SHARED_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi LOCAL_SRC_FILES := \ adb_client.cpp \ Loading
base/include/android-base/stringprintf.h +7 −7 Original line number Diff line number Diff line Loading @@ -28,27 +28,27 @@ namespace base { // if the mingw version of vsnprintf is used, use `gnu_printf' which allows z // in %zd and PRIu64 (and related) to be recognized by the compile-time // checking. #define FORMAT_ARCHETYPE __printf__ #define ANDROID_BASE_FORMAT_ARCHETYPE __printf__ #ifdef __USE_MINGW_ANSI_STDIO #if __USE_MINGW_ANSI_STDIO #undef FORMAT_ARCHETYPE #define FORMAT_ARCHETYPE gnu_printf #undef ANDROID_BASE_FORMAT_ARCHETYPE #define ANDROID_BASE_FORMAT_ARCHETYPE gnu_printf #endif #endif // Returns a string corresponding to printf-like formatting of the arguments. std::string StringPrintf(const char* fmt, ...) __attribute__((__format__(FORMAT_ARCHETYPE, 1, 2))); __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 1, 2))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendF(std::string* dst, const char* fmt, ...) __attribute__((__format__(FORMAT_ARCHETYPE, 2, 3))); __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 3))); // Appends a printf-like formatting of the arguments to 'dst'. void StringAppendV(std::string* dst, const char* format, va_list ap) __attribute__((__format__(FORMAT_ARCHETYPE, 2, 0))); __attribute__((__format__(ANDROID_BASE_FORMAT_ARCHETYPE, 2, 0))); #undef FORMAT_ARCHETYPE #undef ANDROID_BASE_FORMAT_ARCHETYPE } // namespace base } // namespace android Loading
bootstat/bootstat.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -272,6 +272,15 @@ const std::map<std::string, int32_t> kBootReasonMap = { {"reboot_rtc", 132}, {"cold_boot", 133}, {"hard_rst", 134}, {"power-on", 135}, {"oem_adsp_resetting_the_soc", 136}, {"kpdpwr", 137}, {"oem_modem_timeout_waiting", 138}, {"usb_chg", 139}, {"warm_reset_0x02", 140}, {"warm_reset_0x80", 141}, {"pon_reason_0xb0", 142}, {"reboot_download", 143}, }; // Converts a string value representing the reason the system booted to an Loading
debuggerd/handler/debuggerd_handler.cpp +16 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,17 @@ static void debuggerd_signal_handler(int signal_number, siginfo_t* info, void* c fatal_errno("failed to set dumpable"); } // On kernels with yama_ptrace enabled, also allow any process to attach. bool restore_orig_ptracer = true; if (prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY) != 0) { if (errno == EINVAL) { // This kernel does not support PR_SET_PTRACER_ANY, or Yama is not enabled. restore_orig_ptracer = false; } else { fatal_errno("failed to set traceable"); } } // Essentially pthread_create without CLONE_FILES, so we still work during file descriptor // exhaustion. pid_t child_pid = Loading @@ -521,6 +532,11 @@ static void debuggerd_signal_handler(int signal_number, siginfo_t* info, void* c fatal_errno("failed to restore dumpable"); } // Restore PR_SET_PTRACER to its original value. if (restore_orig_ptracer && prctl(PR_SET_PTRACER, 0) != 0) { fatal_errno("failed to restore traceable"); } if (info->si_signo == DEBUGGER_SIGNAL) { // If the signal is fatal, don't unlock the mutex to prevent other crashing threads from // starting to dump right before our death. Loading
fastboot/Android.mk +2 −2 Original line number Diff line number Diff line Loading @@ -50,8 +50,8 @@ LOCAL_LDLIBS_darwin := -lpthread -framework CoreFoundation -framework IOKit -fra LOCAL_CFLAGS_darwin := -Wno-unused-parameter LOCAL_SRC_FILES_windows := usb_windows.cpp LOCAL_STATIC_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinApi AdbWinUsbApi LOCAL_SHARED_LIBRARIES_windows := AdbWinApi LOCAL_REQUIRED_MODULES_windows := AdbWinUsbApi LOCAL_LDLIBS_windows := -lws2_32 LOCAL_C_INCLUDES_windows := development/host/windows/usb/api Loading