6#if defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA) || \
7 defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS)
35 NativeSymbols(
const char* dso_name,
void*
buffer,
size_t size)
36 : next_(nullptr), dso_name_(dso_name) {
37 num_entries_ = *
reinterpret_cast<uint32_t*
>(
buffer);
39 reinterpret_cast<Entry*
>(
reinterpret_cast<uint32_t*
>(
buffer) + 1);
40 name_table_ =
reinterpret_cast<const char*
>(entries_ + num_entries_);
43 NativeSymbols*
next()
const {
return next_; }
44 void set_next(NativeSymbols* symbols) { next_ =
symbols; }
46 bool Lookup(
const char* dso_name,
50 if (strcmp(dso_name, dso_name_) != 0) {
55 intptr_t hi = num_entries_ - 1;
57 intptr_t mid = (hi - lo + 1) / 2 + lo;
60 const Entry& entry = entries_[mid];
61 if (dso_offset < entry.offset) {
63 }
else if (dso_offset >= (entry.offset + entry.size)) {
66 *start_offset = entry.offset;
67 *
name = &name_table_[entry.name_offset];
83 const char*
const dso_name_;
84 intptr_t num_entries_;
86 const char* name_table_;
91static NativeSymbols* symbols_ =
nullptr;
96 NativeSymbols*
symbols = symbols_;
98 while (symbols !=
nullptr) {
107 int r = dladdr(
reinterpret_cast<void*
>(pc), &
info);
112 auto const dso_name =
info.dli_fname;
113 const auto dso_base =
reinterpret_cast<uword>(
info.dli_fbase);
114 const auto dso_offset = pc - dso_base;
116 for (NativeSymbols* symbols = symbols_;
symbols !=
nullptr;
118 uword symbol_start_offset;
119 const char* symbol_name;
120 if (
symbols->Lookup(dso_name, dso_offset, &symbol_start_offset,
122 if (
start !=
nullptr) {
123 *
start = symbol_start_offset + dso_base;
125 return strdup(symbol_name);
129#if !defined(DART_HOST_OS_FUCHSIA)
131 if (
info.dli_sname ==
nullptr) {
134 if (
start !=
nullptr) {
139 char* demangled = abi::__cxa_demangle(
info.dli_sname,
nullptr, &len, &status);
159 int r = dladdr(
reinterpret_cast<void*
>(pc), &
info);
163 if (dso_base !=
nullptr) {
164 *dso_base =
reinterpret_cast<uword>(
info.dli_fbase);
166 if (dso_name !=
nullptr) {
175 NativeSymbols*
symbols =
new NativeSymbols(dso_name,
buffer, size);
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static float next(float f)
static void AddSymbols(const char *dso_name, void *buffer, size_t size)
static void FreeSymbolName(char *name)
static bool LookupSharedObject(uword pc, uword *dso_base=nullptr, char **dso_name=nullptr)
static char * LookupSymbolName(uword pc, uword *start)
static const uint8_t buffer[]
#define MSAN_UNPOISON(ptr, len)
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
char * strdup(const char *str1)