Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit afd6e771 authored by Christopher Ferris's avatar Christopher Ferris Committed by Gerrit Code Review
Browse files

Merge "Always init gnu_debugdata interface if it exists."

parents b59a38d3 e8c4ecf4
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -106,7 +106,7 @@ std::string UnwindStackMap::GetFunctionName(uint64_t pc, uint64_t* offset) {
    return "";
    return "";
  }
  }


  unwindstack::Elf* elf = map_info->GetElf(process_memory(), true);
  unwindstack::Elf* elf = map_info->GetElf(process_memory());


  std::string name;
  std::string name;
  uint64_t func_offset;
  uint64_t func_offset;
+2 −6
Original line number Original line Diff line number Diff line
@@ -40,7 +40,7 @@ bool Elf::cache_enabled_;
std::unordered_map<std::string, std::pair<std::shared_ptr<Elf>, bool>>* Elf::cache_;
std::unordered_map<std::string, std::pair<std::shared_ptr<Elf>, bool>>* Elf::cache_;
std::mutex* Elf::cache_lock_;
std::mutex* Elf::cache_lock_;


bool Elf::Init(bool init_gnu_debugdata) {
bool Elf::Init() {
  load_bias_ = 0;
  load_bias_ = 0;
  if (!memory_) {
  if (!memory_) {
    return false;
    return false;
@@ -54,11 +54,7 @@ bool Elf::Init(bool init_gnu_debugdata) {
  valid_ = interface_->Init(&load_bias_);
  valid_ = interface_->Init(&load_bias_);
  if (valid_) {
  if (valid_) {
    interface_->InitHeaders(load_bias_);
    interface_->InitHeaders(load_bias_);
    if (init_gnu_debugdata) {
    InitGnuDebugdata();
    InitGnuDebugdata();
    } else {
      gnu_debugdata_interface_.reset(nullptr);
    }
  } else {
  } else {
    interface_.reset(nullptr);
    interface_.reset(nullptr);
  }
  }
+1 −1
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ uint64_t Global::GetVariableOffset(MapInfo* info, const std::string& variable) {
    }
    }
  }
  }


  Elf* elf = info->GetElf(memory_, true);
  Elf* elf = info->GetElf(memory_);
  uint64_t ptr;
  uint64_t ptr;
  // Find first non-empty list (libraries might be loaded multiple times).
  // Find first non-empty list (libraries might be loaded multiple times).
  if (elf->GetGlobalVariable(variable, &ptr) && ptr != 0) {
  if (elf->GetGlobalVariable(variable, &ptr) && ptr != 0) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -201,7 +201,7 @@ Elf* JitDebug::GetElf(Maps* maps, uint64_t pc) {
    entry_addr_ = (this->*read_entry_func_)(&start, &size);
    entry_addr_ = (this->*read_entry_func_)(&start, &size);


    Elf* elf = new Elf(new MemoryRange(memory_, start, size, 0));
    Elf* elf = new Elf(new MemoryRange(memory_, start, size, 0));
    elf->Init(true);
    elf->Init();
    if (!elf->valid()) {
    if (!elf->valid()) {
      // The data is not formatted in a way we understand, do not attempt
      // The data is not formatted in a way we understand, do not attempt
      // to process any other entries.
      // to process any other entries.
+1 −1
Original line number Original line Diff line number Diff line
@@ -100,7 +100,7 @@ bool LocalUnwinder::Unwind(std::vector<LocalFrameData>* frame_info, size_t max_f
      break;
      break;
    }
    }


    Elf* elf = map_info->GetElf(process_memory_, true);
    Elf* elf = map_info->GetElf(process_memory_);
    uint64_t rel_pc = elf->GetRelPc(cur_pc, map_info);
    uint64_t rel_pc = elf->GetRelPc(cur_pc, map_info);
    uint64_t step_pc = rel_pc;
    uint64_t step_pc = rel_pc;
    uint64_t pc_adjustment;
    uint64_t pc_adjustment;
Loading