5#include "flutter/testing/elf_loader.h"
9#include "flutter/fml/file.h"
10#include "flutter/fml/paths.h"
11#include "flutter/runtime/dart_vm.h"
12#include "flutter/testing/testing.h"
26 FML_LOG(
ERROR) <<
"App AOT file does not exist for this fixture. Attempts "
27 "to launch the Dart VM with these AOT symbols will fail.";
36 FML_LOG(
ERROR) <<
"Dart doesn't implement Dart_LoadELF on Fuchsia";
40 const char*
error =
nullptr;
52 if (loaded_elf ==
nullptr) {
54 <<
"Could not fetch AOT symbols from loaded ELF. Attempts "
55 "to launch the Dart VM with these AOT symbols will fail. Error: "
60 symbols.loaded_elf.reset(loaded_elf);
67 std::string elf_split_filename) {
86 FML_LOG(
ERROR) <<
"Dart doesn't implement Dart_LoadELF on Fuchsia";
90 const char*
error =
nullptr;
102 if (loaded_elf ==
nullptr) {
104 <<
"Could not fetch AOT symbols from loaded ELF. Attempts "
105 "to launch the Dart VM with these AOT symbols will fail. Error: "
110 symbols.loaded_elf.reset(loaded_elf);
122 return std::make_unique<fml::NonOwnedMapping>(
symbols.vm_snapshot_data, 0u);
124 settings.isolate_snapshot_data = [&]() {
125 return std::make_unique<fml::NonOwnedMapping>(
symbols.vm_isolate_data, 0u);
127 settings.vm_snapshot_instr = [&]() {
128 return std::make_unique<fml::NonOwnedMapping>(
symbols.vm_snapshot_instrs,
131 settings.isolate_snapshot_instr = [&]() {
132 return std::make_unique<fml::NonOwnedMapping>(
symbols.vm_isolate_instrs,
static bool IsRunningPrecompiledCode()
Checks if VM instances in the process can run precompiled code. This call can be made at any time and...
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
const char * GetFixturesPath()
Returns the directory containing the test fixture for the target if this target has fixtures configur...
ELFAOTSymbols LoadELFSymbolFromFixturesIfNeccessary(std::string elf_filename)
Attempts to resolve AOT symbols from the portable ELF loader. This location is automatically resolved...
bool PrepareSettingsForAOTWithSymbols(Settings &settings, const ELFAOTSymbols &symbols)
Prepare the settings objects various AOT mappings resolvers with the symbols already loaded....
ELFAOTSymbols LoadELFSplitSymbolFromFixturesIfNeccessary(std::string elf_split_filename)
Attempts to resolve split loading unit AOT symbols from the portable ELF loader. If the dart code doe...
std::string JoinPaths(std::initializer_list< std::string > components)
bool IsFile(const std::string &path)
DART_EXPORT Dart_LoadedElf * Dart_LoadELF(const char *filename, uint64_t file_offset, const char **error, const uint8_t **vm_snapshot_data, const uint8_t **vm_snapshot_instrs, const uint8_t **vm_isolate_data, const uint8_t **vm_isolate_instrs)
Please see documentation for Dart_LoadElf_Fd.