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

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

Merge "Fix off by 4 error handling eh_frame hdr."

parents ecff5897 e37e2d05
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -248,6 +248,7 @@ cc_test {
        "tests/files/elf64.xz",
        "tests/files/offline/bad_eh_frame_hdr_arm64/*",
        "tests/files/offline/debug_frame_first_x86/*",
        "tests/files/offline/eh_frame_hdr_begin_x86_64/*",
        "tests/files/offline/jit_debug_arm/*",
        "tests/files/offline/jit_debug_x86/*",
        "tests/files/offline/gnu_debugdata_arm/*",
@@ -306,6 +307,15 @@ cc_binary {
    ],
}

cc_binary {
    name: "unwind_reg_info",
    defaults: ["libunwindstack_tools"],

    srcs: [
        "tools/unwind_reg_info.cpp",
    ],
}

// Generates the elf data for use in the tests for .gnu_debugdata frames.
// Once these files are generated, use the xz command to compress the data.
cc_binary_host {
+1 −1
Original line number Diff line number Diff line
@@ -109,7 +109,7 @@ DwarfEhFrameWithHdr<AddressType>::GetFdeInfoFromIndex(size_t index) {
    fde_info_.erase(index);
    return nullptr;
  }
  info->pc = value + 4;
  info->pc = value;
  return info;
}

+4 −4
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeInfoFromIndex_read_pcrel) {

  auto info = this->eh_frame_->GetFdeInfoFromIndex(2);
  ASSERT_TRUE(info != nullptr);
  EXPECT_EQ(0x1384U, info->pc);
  EXPECT_EQ(0x1380U, info->pc);
  EXPECT_EQ(0x1540U, info->offset);
}

@@ -149,7 +149,7 @@ TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeInfoFromIndex_read_datarel) {

  auto info = this->eh_frame_->GetFdeInfoFromIndex(2);
  ASSERT_TRUE(info != nullptr);
  EXPECT_EQ(0x3344U, info->pc);
  EXPECT_EQ(0x3340U, info->pc);
  EXPECT_EQ(0x3500U, info->offset);
}

@@ -163,7 +163,7 @@ TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeInfoFromIndex_cached) {

  auto info = this->eh_frame_->GetFdeInfoFromIndex(2);
  ASSERT_TRUE(info != nullptr);
  EXPECT_EQ(0x344U, info->pc);
  EXPECT_EQ(0x340U, info->pc);
  EXPECT_EQ(0x500U, info->offset);

  // Clear the memory so that this will fail if it doesn't read cached data.
@@ -171,7 +171,7 @@ TYPED_TEST_P(DwarfEhFrameWithHdrTest, GetFdeInfoFromIndex_cached) {

  info = this->eh_frame_->GetFdeInfoFromIndex(2);
  ASSERT_TRUE(info != nullptr);
  EXPECT_EQ(0x344U, info->pc);
  EXPECT_EQ(0x340U, info->pc);
  EXPECT_EQ(0x500U, info->offset);
}

+185 −320

File changed.

Preview size limit exceeded, changes collapsed.

+64 B

File added.

No diff preview for this file type.

Loading