summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-01-30 15:02:39 -0800
committerYabin Cui <yabinc@google.com>2018-01-30 15:02:39 -0800
commit922b874997dc1a45d7158d31f2dcc208e71719e7 (patch)
treea0a52d6fc6b04caa195eb665b9d5d8550d9314db
parent1c24112b790617aa7f2eb95a27772345fdc29eb1 (diff)
downloadextras-922b874997dc1a45d7158d31f2dcc208e71719e7.tar.gz
simpleperf: fix mac build.
Bug: none Test: none Change-Id: Ia4e6dd0e44e19379d79a08a8555ad413ba879bf2
-rw-r--r--simpleperf/OfflineUnwinder.cpp2
-rw-r--r--simpleperf/read_apk.cpp4
-rw-r--r--simpleperf/read_apk.h4
-rw-r--r--simpleperf/read_apk_test.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/simpleperf/OfflineUnwinder.cpp b/simpleperf/OfflineUnwinder.cpp
index 03d75b68..cd53744c 100644
--- a/simpleperf/OfflineUnwinder.cpp
+++ b/simpleperf/OfflineUnwinder.cpp
@@ -155,7 +155,7 @@ bool OfflineUnwinder::UnwindCallChain(int abi, const ThreadEntry& thread, const
// the previous format (apk, offset).
std::string shared_lib(bt_map.name.substr(apk_pos + 2));
bt_map.name = bt_map.name.substr(0, apk_pos);
- off64_t offset;
+ uint64_t offset;
uint32_t length;
if (ApkInspector::FindOffsetInApkByName(bt_map.name, shared_lib, &offset, &length)) {
bt_map.offset = offset;
diff --git a/simpleperf/read_apk.cpp b/simpleperf/read_apk.cpp
index 994edfb2..b2d0b85d 100644
--- a/simpleperf/read_apk.cpp
+++ b/simpleperf/read_apk.cpp
@@ -111,7 +111,7 @@ std::unique_ptr<EmbeddedElf> ApkInspector::FindElfInApkByOffsetWithoutCache(cons
}
bool ApkInspector::FindOffsetInApkByName(const std::string& apk_path,
- const std::string& elf_filename, off64_t* offset,
+ const std::string& elf_filename, uint64_t* offset,
uint32_t* uncompressed_length) {
if (!IsValidApkPath(apk_path)) {
return false;
@@ -143,7 +143,7 @@ bool ApkInspector::FindOffsetInApkByName(const std::string& apk_path,
std::unique_ptr<EmbeddedElf> ApkInspector::FindElfInApkByName(const std::string& apk_path,
const std::string& elf_filename) {
- off64_t offset;
+ uint64_t offset;
uint32_t uncompressed_length;
if (!FindOffsetInApkByName(apk_path, elf_filename, &offset, &uncompressed_length)) {
return nullptr;
diff --git a/simpleperf/read_apk.h b/simpleperf/read_apk.h
index 279909ee..26c266c3 100644
--- a/simpleperf/read_apk.h
+++ b/simpleperf/read_apk.h
@@ -37,7 +37,7 @@ class EmbeddedElf {
EmbeddedElf(const std::string& filepath,
const std::string& entry_name,
- size_t entry_offset,
+ uint64_t entry_offset,
size_t entry_size)
: filepath_(filepath)
, entry_name_(entry_name)
@@ -73,7 +73,7 @@ class ApkInspector {
// ELF file, then return pertinent info on the ELF.
static bool FindOffsetInApkByName(const std::string& apk_path,
const std::string& elf_filename,
- off64_t* offset, uint32_t* uncompressed_length);
+ uint64_t* offset, uint32_t* uncompressed_length);
static EmbeddedElf* FindElfInApkByOffset(const std::string& apk_path, uint64_t file_offset);
static std::unique_ptr<EmbeddedElf> FindElfInApkByName(const std::string& apk_path,
const std::string& elf_filename);
diff --git a/simpleperf/read_apk_test.cpp b/simpleperf/read_apk_test.cpp
index b4f1fec2..f9640e82 100644
--- a/simpleperf/read_apk_test.cpp
+++ b/simpleperf/read_apk_test.cpp
@@ -42,7 +42,7 @@ TEST(read_apk, FindElfInApkByOffset) {
}
TEST(read_apk, FindOffsetInApkByName) {
- off64_t offset;
+ uint64_t offset;
uint32_t length;
ASSERT_FALSE(ApkInspector::FindOffsetInApkByName("/dev/null", "", &offset, &length));
ASSERT_FALSE(ApkInspector::FindOffsetInApkByName(GetTestData(APK_FILE), "", &offset, &length));