summaryrefslogtreecommitdiffstats
path: root/src/oat_file.h
diff options
context:
space:
mode:
authorLogan Chien <loganchien@google.com>2012-03-20 22:57:52 +0800
committerShih-wei Liao <sliao@google.com>2012-03-26 21:10:25 -0700
commit0cc6ab6c5104f565a0a3256b5b2b31c6383be189 (patch)
treecf9d24d85b8111cc7fab59d4ccb52485948111c3 /src/oat_file.h
parent25ae64082c2583a080b9d0bd005d2efd09e81723 (diff)
downloadart-0cc6ab6c5104f565a0a3256b5b2b31c6383be189.zip
art-0cc6ab6c5104f565a0a3256b5b2b31c6383be189.tar.gz
art-0cc6ab6c5104f565a0a3256b5b2b31c6383be189.tar.bz2
Add ELF extractor to oatdump.
(cherry picked from commit 0228e7eacadb1c829e4e1064bec0792c2696e66f) Change-Id: I649b14b6f8ec9ba43f82c3670f88b064ac008ada
Diffstat (limited to 'src/oat_file.h')
-rw-r--r--src/oat_file.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/oat_file.h b/src/oat_file.h
index 3243fe2..8ef8308 100644
--- a/src/oat_file.h
+++ b/src/oat_file.h
@@ -211,10 +211,39 @@ class OatFile {
DISALLOW_COPY_AND_ASSIGN(OatDexFile);
};
+ class OatElfImage {
+ public:
+ const byte* begin() const {
+ return elf_addr_;
+ }
+
+ const byte* end() const {
+ return (elf_addr_ + elf_size_);
+ }
+
+ size_t size() const {
+ return elf_size_;
+ }
+
+ private:
+ OatElfImage(const OatFile* oat_file, const byte* addr, uint32_t size);
+
+ const OatFile* oat_file_;
+ const byte* elf_addr_;
+ uint32_t elf_size_;
+
+ friend class OatFile;
+ DISALLOW_COPY_AND_ASSIGN(OatElfImage);
+ };
+
const OatDexFile* GetOatDexFile(const std::string& dex_file_location,
bool warn_if_not_found = true) const;
std::vector<const OatDexFile*> GetOatDexFiles() const;
+ const OatElfImage* GetOatElfImage(size_t i) const {
+ return oat_elf_images_[i];
+ }
+
size_t Size() const {
return End() - Begin();
}
@@ -237,6 +266,8 @@ class OatFile {
typedef std::map<std::string, const OatDexFile*> Table;
Table oat_dex_files_;
+ std::vector<OatElfImage*> oat_elf_images_;
+
friend class OatClass;
friend class OatDexFile;
friend class OatDumper; // For GetBase and GetLimit