summaryrefslogtreecommitdiffstats
path: root/runtime/oat.h
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2014-12-12 15:25:14 -0800
committerAndreas Gampe <agampe@google.com>2014-12-15 08:13:39 -0800
commit2bcb3b228bc418bcc7fdc3d58d0a0da422a0b6d5 (patch)
tree8c37d77a5d7784ddbbaf221c72c0e66792c5a872 /runtime/oat.h
parentd1512fed4e43bba77fb21fd1b6322c22ef7c5881 (diff)
downloadart-2bcb3b228bc418bcc7fdc3d58d0a0da422a0b6d5.zip
art-2bcb3b228bc418bcc7fdc3d58d0a0da422a0b6d5.tar.gz
art-2bcb3b228bc418bcc7fdc3d58d0a0da422a0b6d5.tar.bz2
ART: Show invalid oat header cause in error message
Include the IsValid failure cause in the error message of opening an oat file. Make oat magic and version constexpr so we can have static_asserts over the lengths. Bug: 17187621 Change-Id: I8cef1c6cc9cb2faa052167a3437e81b4c2cbefa7
Diffstat (limited to 'runtime/oat.h')
-rw-r--r--runtime/oat.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/runtime/oat.h b/runtime/oat.h
index 6098fbd..f218482 100644
--- a/runtime/oat.h
+++ b/runtime/oat.h
@@ -31,8 +31,8 @@ class InstructionSetFeatures;
class PACKED(4) OatHeader {
public:
- static const uint8_t kOatMagic[4];
- static const uint8_t kOatVersion[4];
+ static constexpr uint8_t kOatMagic[] = { 'o', 'a', 't', '\n' };
+ static constexpr uint8_t kOatVersion[] = { '0', '4', '5', '\0' };
static constexpr const char* kImageLocationKey = "image-location";
static constexpr const char* kDex2OatCmdLineKey = "dex2oat-cmdline";
@@ -47,6 +47,7 @@ class PACKED(4) OatHeader {
const SafeMap<std::string, std::string>* variable_data);
bool IsValid() const;
+ std::string GetValidationErrorMessage() const;
const char* GetMagic() const;
uint32_t GetChecksum() const;
void UpdateChecksum(const void* data, size_t length);