Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
vm
os.cc
Go to the documentation of this file.
1
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#include "
vm/os.h
"
6
7
#include "
platform/assert.h
"
8
#include "
vm/image_snapshot.h
"
9
#include "
vm/native_symbol.h
"
10
11
namespace
dart
{
12
13
const
uint8_t*
OS::GetAppDSOBase
(
const
uint8_t* snapshot_instructions) {
14
// Use the relocated address in the Image if the snapshot was compiled
15
// directly to ELF.
16
const
Image
instructions_image(snapshot_instructions);
17
if
(instructions_image.
compiled_to_elf
()) {
18
return
snapshot_instructions -
19
instructions_image.
instructions_relocated_address
();
20
}
21
uword
dso_base;
22
if
(
NativeSymbolResolver::LookupSharedObject
(
23
reinterpret_cast<
uword
>
(snapshot_instructions), &dso_base)) {
24
return
reinterpret_cast<
const
uint8_t*
>
(dso_base);
25
}
26
UNIMPLEMENTED
();
27
return
nullptr
;
28
}
29
30
}
// namespace dart
assert.h
dart::Image
Definition
image_snapshot.h:39
dart::Image::compiled_to_elf
bool compiled_to_elf() const
Definition
image_snapshot.cc:115
dart::Image::instructions_relocated_address
uword instructions_relocated_address() const
Definition
image_snapshot.cc:82
dart::NativeSymbolResolver::LookupSharedObject
static bool LookupSharedObject(uword pc, uword *dso_base=nullptr, char **dso_name=nullptr)
dart::OS::GetAppDSOBase
static const uint8_t * GetAppDSOBase(const uint8_t *snapshot_instructions)
Definition
os.cc:13
UNIMPLEMENTED
#define UNIMPLEMENTED
Definition
dl_dispatcher.cc:36
image_snapshot.h
dart
Definition
dart_vm.cc:33
dart::uword
uintptr_t uword
Definition
globals.h:501
native_symbol.h
os.h
Generated on Fri Apr 26 2024 06:15:15 for Flutter Engine by
1.9.8