| Index: runtime/vm/debuginfo_android.cc
|
| diff --git a/runtime/vm/debuginfo_android.cc b/runtime/vm/debuginfo_android.cc
|
| index 4e56b3c507df38c68fb1d171a3481cc23479781c..1a11e1bb663c1715b7b39c03d238862485aa8c4c 100644
|
| --- a/runtime/vm/debuginfo_android.cc
|
| +++ b/runtime/vm/debuginfo_android.cc
|
| @@ -4,31 +4,38 @@
|
|
|
| #include "vm/debuginfo.h"
|
|
|
| +#include "vm/elfgen.h"
|
| +#include "vm/gdbjit_android.h"
|
|
|
| namespace dart {
|
|
|
| DebugInfo::DebugInfo() {
|
| - handle_ = NULL;
|
| + handle_ = reinterpret_cast<void*>(new ElfGen());
|
| + ASSERT(handle_ != NULL);
|
| }
|
|
|
|
|
| DebugInfo::~DebugInfo() {
|
| + ElfGen* elf_gen = reinterpret_cast<ElfGen*>(handle_);
|
| + delete elf_gen;
|
| }
|
|
|
|
|
| void DebugInfo::AddCode(uword pc, intptr_t size) {
|
| - // Nothing to do as there is no support for this on Android.
|
| + ElfGen* elf_gen = reinterpret_cast<ElfGen*>(handle_);
|
| + elf_gen->AddCode(pc, size);
|
| }
|
|
|
|
|
| void DebugInfo::AddCodeRegion(const char* name, uword pc, intptr_t size) {
|
| - // Nothing to do as there is no support for this on Android.
|
| + ElfGen* elf_gen = reinterpret_cast<ElfGen*>(handle_);
|
| + elf_gen->AddCodeRegion(name, pc, size);
|
| }
|
|
|
|
|
| bool DebugInfo::WriteToMemory(ByteBuffer* region) {
|
| - // Nothing to do as there is no support for this on Android.
|
| - return false;
|
| + ElfGen* elf_gen = reinterpret_cast<ElfGen*>(handle_);
|
| + return elf_gen->WriteToMemory(region);
|
| }
|
|
|
|
|
| @@ -40,12 +47,26 @@ DebugInfo* DebugInfo::NewGenerator() {
|
| void DebugInfo::RegisterSection(const char* name,
|
| uword entry_point,
|
| intptr_t size) {
|
| - // Nothing to do as there is no support for this on Android.
|
| + ElfGen* elf_section = new ElfGen();
|
| + ASSERT(elf_section != NULL);
|
| + elf_section->AddCode(entry_point, size);
|
| + elf_section->AddCodeRegion(name, entry_point, size);
|
| +
|
| + ByteBuffer* dynamic_region = new ByteBuffer();
|
| + ASSERT(dynamic_region != NULL);
|
| +
|
| + elf_section->WriteToMemory(dynamic_region);
|
| +
|
| + ::addDynamicSection(reinterpret_cast<const char*>(dynamic_region->data()),
|
| + dynamic_region->size());
|
| + dynamic_region->set_data(NULL);
|
| + delete dynamic_region;
|
| + delete elf_section;
|
| }
|
|
|
|
|
| void DebugInfo::UnregisterAllSections() {
|
| - // Nothing to do as there is no support for this on Android.
|
| + ::deleteDynamicSections();
|
| }
|
|
|
| } // namespace dart
|
|
|