16#if defined(SK_BUILD_FOR_GOOGLE3)
20#if defined(GOOGLE_ENABLE_SIGNAL_HANDLERS)
21 #include "base/process_state.h"
26 #if defined(SK_BUILD_FOR_MAC)
28 #define UNW_LOCAL_ONLY
29 #include <libunwind.h>
32 static void handler(
int sig) {
33 unw_context_t context;
34 unw_getcontext(&context);
37 unw_init_local(&cursor, &context);
40 while (unw_step(&cursor) > 0) {
41 static const size_t kMax = 256;
44 unw_get_proc_name(&cursor, mangled, kMax, &
offset);
48 abi::__cxa_demangle(mangled, demangled, &
len, &
ok);
58 #elif defined(SK_BUILD_FOR_UNIX)
64#if defined(__Fuchsia__)
71 #define BACKTRACE_REQUEST_MAGIC ((uint64_t)0xee726573756d65ee)
74 __attribute__((always_inline))
static inline void backtrace_request(
void) {
85 __asm__(
"int3" : :
"a"(BACKTRACE_REQUEST_MAGIC));
93 :
"r"(BACKTRACE_REQUEST_MAGIC)
101 static void handler(
int sig) {
102#if defined(__Fuchsia__)
109 SkDebugf(
"\nSignal %d [%s]:\n", sig, strsignal(sig));
112 if (dladdr(stack[
i], &
info) &&
info.dli_sname) {
117 abi::__cxa_demangle(
info.dli_sname, demangled, &
len, &
ok);
132 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX)
136 static const int kSignals[] = {
145 for (
size_t i = 0;
i <
sizeof(kSignals) /
sizeof(kSignals[0]);
i++) {
147 void (*
prev)(
int) = signal(kSignals[
i], handler);
148 if (
prev != SIG_DFL) {
149 signal(kSignals[
i],
prev);
154 #elif defined(SK_BUILD_FOR_WIN)
160 static const struct {
165 _(EXCEPTION_ACCESS_VIOLATION),
166 _(EXCEPTION_BREAKPOINT),
167 _(EXCEPTION_INT_DIVIDE_BY_ZERO),
168 _(EXCEPTION_STACK_OVERFLOW),
173 static LONG WINAPI handler(EXCEPTION_POINTERS*
e) {
174 const DWORD code =
e->ExceptionRecord->ExceptionCode;
184 HANDLE hProcess = GetCurrentProcess();
185 SymInitialize(hProcess, 0,
true);
190 CONTEXT* c =
e->ContextRecord;
191 frame.AddrPC.Mode = AddrModeFlat;
192 frame.AddrStack.Mode = AddrModeFlat;
193 frame.AddrFrame.Mode = AddrModeFlat;
195 frame.AddrPC.Offset = c->Eip;
196 frame.AddrStack.Offset = c->Esp;
197 frame.AddrFrame.Offset = c->Ebp;
198 const DWORD machineType = IMAGE_FILE_MACHINE_I386;
199 #elif defined(_AMD64_)
200 frame.AddrPC.Offset = c->Rip;
201 frame.AddrStack.Offset = c->Rsp;
202 frame.AddrFrame.Offset = c->Rbp;
203 const DWORD machineType = IMAGE_FILE_MACHINE_AMD64;
204 #elif defined(_M_ARM64)
205 frame.AddrPC.Offset = c->Pc;
206 frame.AddrStack.Offset = c->Sp;
207 frame.AddrFrame.Offset = c->Fp;
208 const DWORD machineType = IMAGE_FILE_MACHINE_ARM64;
211 #if !defined(SK_WINUWP)
212 while (StackWalk64(machineType,
218 SymFunctionTableAccess64,
222 static const int kMaxNameLength = 1024;
223 uint8_t
buffer[
sizeof(IMAGEHLP_SYMBOL64) + kMaxNameLength];
228 IMAGEHLP_SYMBOL64* symbol =
reinterpret_cast<IMAGEHLP_SYMBOL64*
>(&
buffer);
229 symbol->SizeOfStruct =
sizeof(IMAGEHLP_SYMBOL64);
230 symbol->MaxNameLength = kMaxNameLength - 1;
234 SymGetSymFromAddr64(hProcess,
frame.AddrPC.Offset, &
offset, symbol);
245 return EXCEPTION_EXECUTE_HANDLER;
249 SetUnhandledExceptionFilter(handler);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
sk_bzero(glyphs, sizeof(glyphs))
static float prev(float f)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static bool ok(int result)
__asm__(".symver expf,expf@GLIBC_2.4")
__attribute__((visibility("default"))) int RunBenchmarks(int argc
DEF_SWITCHES_START aot vmservice shared library name
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size