Improvements in Debugger::AccessMemory
@@ -496,6 +496,8 @@ bool CLR_DBG_Debugger::AccessMemory( CLR_UINT32 location, unsigned int lengthInB
NATIVE_PROFILE_CLR_DEBUGGER();
TRACE("AccessMemory( 0x%08X, 0x%08x, 0x%08X, %s)\n", location, lengthInBytes, buf, AccessMemoryModeNames[mode] );
+ bool success = false;
+
// reset error code
*errorCode = AccessMemoryErrorCode_NoError;
@@ -510,7 +512,6 @@ bool CLR_DBG_Debugger::AccessMemory( CLR_UINT32 location, unsigned int lengthInB
ByteAddress accessAddress = location;
unsigned char* bufPtr = buf;
- bool success = true;
signed int accessLenInBytes = lengthInBytes;
signed int blockOffset = BlockRegionInfo_OffsetFromBlock(((BlockRegionInfo*)(&deviceInfo->Regions[iRegion])), accessAddress);
@@ -549,7 +550,8 @@ bool CLR_DBG_Debugger::AccessMemory( CLR_UINT32 location, unsigned int lengthInB
// set error code
*errorCode = AccessMemoryErrorCode_PermissionDenied;
- return false;
+ // done here
+ return success;
}
switch(mode)
@@ -574,7 +576,8 @@ bool CLR_DBG_Debugger::AccessMemory( CLR_UINT32 location, unsigned int lengthInB
// set error code
*errorCode = AccessMemoryErrorCode_PermissionDenied;
- return false;
+ // done here
+ return success;
}
}
@@ -627,9 +630,10 @@ bool CLR_DBG_Debugger::AccessMemory( CLR_UINT32 location, unsigned int lengthInB
iRange = 0;
if ((accessLenInBytes <= 0) || (!success))
+ {
break;
}
-
+ }
}
else
{
@@ -666,7 +670,7 @@ bool CLR_DBG_Debugger::AccessMemory( CLR_UINT32 location, unsigned int lengthInB
if((sectAddr <ramStartAddress) || (sectAddr >=ramEndAddress) || (sectAddrEnd >ramEndAddress) )
{
TRACE(" Invalid address %x and range %x Ram Start %x, Ram end %x\r\n", sectAddr, lengthInBytes, ramStartAddress, ramEndAddress);
- return false;
+ return success;
}
else
#endif
@@ -697,8 +701,10 @@ bool CLR_DBG_Debugger::AccessMemory( CLR_UINT32 location, unsigned int lengthInB
}
}
}
+
TRACE0( "=> SUCCESS\n");
- return true;
+
+ return success;
}
bool CLR_DBG_Debugger::Monitor_ReadMemory( WP_Message* msg)
