diff options
author | David Srbecky <dsrbecky@google.com> | 2021-02-14 21:42:08 +0000 |
---|---|---|
committer | David Srbecky <dsrbecky@google.com> | 2021-03-09 22:10:03 +0000 |
commit | 0b6d9eefdc4996ce99c799dc6d23a388e969c2af (patch) | |
tree | 787db46db092526de0ca9f393c8210c672732804 /libunwindstack/JitDebug.cpp | |
parent | 8c9b52bdf55e82a4d60fedc12db3784c1ffd4a50 (diff) | |
download | unwinding-0b6d9eefdc4996ce99c799dc6d23a388e969c2af.tar.gz |
Add helpers to create JitDebug and DexFiles.
These helpers will make it easier to replace the
implementation without affecting users of the classes.
The helpers take the arch, which ensures it is set and
it allows to return templated variant based on the arch.
Test: art/test.py -r -b --host -t 137-cfi
Test: libunwindstack_test
Change-Id: I6e09ce29e39faa57c95fc8a3e86f2260bf91a76e
Diffstat (limited to 'libunwindstack/JitDebug.cpp')
-rw-r--r-- | libunwindstack/JitDebug.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libunwindstack/JitDebug.cpp b/libunwindstack/JitDebug.cpp index 8ad6a57..1dd4e11 100644 --- a/libunwindstack/JitDebug.cpp +++ b/libunwindstack/JitDebug.cpp @@ -24,6 +24,7 @@ #include <unwindstack/JitDebug.h> #include <unwindstack/Maps.h> +#include "Check.h" #include "MemoryRange.h" // This implements the JIT Compilation Interface. @@ -219,4 +220,12 @@ Elf* JitDebug::Find(Maps* maps, uint64_t pc) { return nullptr; } +std::unique_ptr<JitDebug> CreateJitDebug(ArchEnum arch, std::shared_ptr<Memory>& memory, + std::vector<std::string> search_libs) { + CHECK(arch != ARCH_UNKNOWN); + std::unique_ptr<JitDebug> jit_debug(new JitDebug(memory, search_libs)); + jit_debug->SetArch(arch); + return jit_debug; +} + } // namespace unwindstack |