Breakpad processor: Make PostfixEvaluator treat the MemoryRegion as const.

In order to be able to treat any MemoryRegion as const, the accessor
functions need to be declared this-const, which means annotations on
all the subclasses, etc. etc.

Since MinidumpMemoryRegion fills its memory_ member on demand, that
member needs to be marked 'mutable', but this is exactly the sort of
situation the 'mutable' keyword was intended for, so that seems all
right.

a=jimblandy, r=nealsid


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@509 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
jimblandy 2010-02-05 17:17:24 +00:00
parent e87521a989
commit 2214cb9bc1
5 changed files with 35 additions and 35 deletions

View file

@ -1106,7 +1106,7 @@ void MinidumpMemoryRegion::SetDescriptor(MDMemoryDescriptor* descriptor) {
}
const u_int8_t* MinidumpMemoryRegion::GetMemory() {
const u_int8_t* MinidumpMemoryRegion::GetMemory() const {
if (!valid_) {
BPLOG(ERROR) << "Invalid MinidumpMemoryRegion for GetMemory";
return NULL;
@ -1145,7 +1145,7 @@ const u_int8_t* MinidumpMemoryRegion::GetMemory() {
}
u_int64_t MinidumpMemoryRegion::GetBase() {
u_int64_t MinidumpMemoryRegion::GetBase() const {
if (!valid_) {
BPLOG(ERROR) << "Invalid MinidumpMemoryRegion for GetBase";
return static_cast<u_int64_t>(-1);
@ -1155,7 +1155,7 @@ u_int64_t MinidumpMemoryRegion::GetBase() {
}
u_int32_t MinidumpMemoryRegion::GetSize() {
u_int32_t MinidumpMemoryRegion::GetSize() const {
if (!valid_) {
BPLOG(ERROR) << "Invalid MinidumpMemoryRegion for GetSize";
return 0;
@ -1173,7 +1173,7 @@ void MinidumpMemoryRegion::FreeMemory() {
template<typename T>
bool MinidumpMemoryRegion::GetMemoryAtAddressInternal(u_int64_t address,
T* value) {
T* value) const {
BPLOG_IF(ERROR, !value) << "MinidumpMemoryRegion::GetMemoryAtAddressInternal "
"requires |value|";
assert(value);
@ -1215,25 +1215,25 @@ bool MinidumpMemoryRegion::GetMemoryAtAddressInternal(u_int64_t address,
bool MinidumpMemoryRegion::GetMemoryAtAddress(u_int64_t address,
u_int8_t* value) {
u_int8_t* value) const {
return GetMemoryAtAddressInternal(address, value);
}
bool MinidumpMemoryRegion::GetMemoryAtAddress(u_int64_t address,
u_int16_t* value) {
u_int16_t* value) const {
return GetMemoryAtAddressInternal(address, value);
}
bool MinidumpMemoryRegion::GetMemoryAtAddress(u_int64_t address,
u_int32_t* value) {
u_int32_t* value) const {
return GetMemoryAtAddressInternal(address, value);
}
bool MinidumpMemoryRegion::GetMemoryAtAddress(u_int64_t address,
u_int64_t* value) {
u_int64_t* value) const {
return GetMemoryAtAddressInternal(address, value);
}