832a205895
Flutter does not support Android versions below Android 7 (API level
24).
Simplify the code by removing workaround introduced in
a013de84e0 to work-around crashes
which only happen on Android 6.0.0.
TEST=ci
Cq-Include-Trybots: luci.dart.try:vm-aot-android-release-arm_x64-try,vm-aot-android-release-arm64c-try
Change-Id: Ib29535e66e87b17bc9b2ac72bcbb46e06a6a6964
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472861
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
61 lines
1.9 KiB
C++
61 lines
1.9 KiB
C++
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
#ifndef RUNTIME_VM_SIGNAL_HANDLER_H_
|
|
#define RUNTIME_VM_SIGNAL_HANDLER_H_
|
|
|
|
#include "vm/allocation.h"
|
|
#include "vm/globals.h"
|
|
|
|
#if defined(DART_HOST_OS_LINUX)
|
|
#include <signal.h> // NOLINT
|
|
#include <ucontext.h> // NOLINT
|
|
#elif defined(DART_HOST_OS_ANDROID)
|
|
#include <signal.h> // NOLINT
|
|
#if !defined(__BIONIC_HAVE_UCONTEXT_T)
|
|
#include <asm/sigcontext.h> // NOLINT
|
|
// If ucontext_t is not defined on Android, define it here.
|
|
typedef struct sigcontext mcontext_t;
|
|
typedef struct ucontext {
|
|
uint32_t uc_flags;
|
|
struct ucontext* uc_link;
|
|
stack_t uc_stack;
|
|
struct sigcontext uc_mcontext;
|
|
uint32_t uc_sigmask;
|
|
} ucontext_t;
|
|
#endif // !defined(__BIONIC_HAVE_UCONTEXT_T)
|
|
#elif defined(DART_HOST_OS_MACOS)
|
|
#include <signal.h> // NOLINT
|
|
#include <sys/ucontext.h> // NOLINT
|
|
#elif defined(DART_HOST_OS_WINDOWS)
|
|
// Stub out for windows.
|
|
struct siginfo_t;
|
|
struct mcontext_t;
|
|
struct sigset_t {};
|
|
#elif defined(DART_HOST_OS_FUCHSIA)
|
|
#include <signal.h> // NOLINT
|
|
#include <ucontext.h> // NOLINT
|
|
#endif
|
|
|
|
namespace dart {
|
|
|
|
typedef void (*SignalAction)(int signal, siginfo_t* info, void* context);
|
|
|
|
class SignalHandler : public AllStatic {
|
|
public:
|
|
static void Install(SignalAction action);
|
|
static void Remove();
|
|
static uintptr_t GetProgramCounter(const mcontext_t& mcontext);
|
|
static uintptr_t GetFramePointer(const mcontext_t& mcontext);
|
|
static uintptr_t GetCStackPointer(const mcontext_t& mcontext);
|
|
static uintptr_t GetDartStackPointer(const mcontext_t& mcontext);
|
|
static uintptr_t GetLinkRegister(const mcontext_t& mcontext);
|
|
};
|
|
|
|
#undef USE_SIGNAL_HANDLER_TRAMPOLINE
|
|
|
|
} // namespace dart
|
|
|
|
#endif // RUNTIME_VM_SIGNAL_HANDLER_H_
|