summaryrefslogtreecommitdiff
path: root/libunwindstack/DexFiles.cpp
diff options
context:
space:
mode:
authorSteven Laver <lavers@google.com>2019-12-12 15:29:36 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-12-12 15:29:36 +0000
commita239544c7b06814b70fd970de7eaac234682fa52 (patch)
treea4298d61f9b73642f350799b1157e49b65f4e1e8 /libunwindstack/DexFiles.cpp
parent63de1e1c8d7824c241f22de67edf54f4f1eaeea5 (diff)
parent5319412e5305a3b4bcecf251a2955c09a6e9837e (diff)
Merge "Merge RP1A.191203.001" into r-keystone-qcom-dev
Diffstat (limited to 'libunwindstack/DexFiles.cpp')
-rw-r--r--libunwindstack/DexFiles.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/libunwindstack/DexFiles.cpp b/libunwindstack/DexFiles.cpp
index 63a77e50f..2057fad19 100644
--- a/libunwindstack/DexFiles.cpp
+++ b/libunwindstack/DexFiles.cpp
@@ -27,10 +27,21 @@
#include <unwindstack/Maps.h>
#include <unwindstack/Memory.h>
+#if defined(DEXFILE_SUPPORT)
#include "DexFile.h"
+#endif
namespace unwindstack {
+#if !defined(DEXFILE_SUPPORT)
+// Empty class definition.
+class DexFile {
+ public:
+ DexFile() = default;
+ virtual ~DexFile() = default;
+};
+#endif
+
struct DEXFileEntry32 {
uint32_t next;
uint32_t prev;
@@ -128,6 +139,7 @@ void DexFiles::Init(Maps* maps) {
FindAndReadVariable(maps, "__dex_debug_descriptor");
}
+#if defined(DEXFILE_SUPPORT)
DexFile* DexFiles::GetDexFile(uint64_t dex_file_offset, MapInfo* info) {
// Lock while processing the data.
DexFile* dex_file;
@@ -141,6 +153,11 @@ DexFile* DexFiles::GetDexFile(uint64_t dex_file_offset, MapInfo* info) {
}
return dex_file;
}
+#else
+DexFile* DexFiles::GetDexFile(uint64_t, MapInfo*) {
+ return nullptr;
+}
+#endif
bool DexFiles::GetAddr(size_t index, uint64_t* addr) {
if (index < addrs_.size()) {
@@ -154,6 +171,7 @@ bool DexFiles::GetAddr(size_t index, uint64_t* addr) {
return false;
}
+#if defined(DEXFILE_SUPPORT)
void DexFiles::GetMethodInformation(Maps* maps, MapInfo* info, uint64_t dex_pc,
std::string* method_name, uint64_t* method_offset) {
std::lock_guard<std::mutex> guard(lock_);
@@ -175,5 +193,8 @@ void DexFiles::GetMethodInformation(Maps* maps, MapInfo* info, uint64_t dex_pc,
}
}
}
+#else
+void DexFiles::GetMethodInformation(Maps*, MapInfo*, uint64_t, std::string*, uint64_t*) {}
+#endif
} // namespace unwindstack