CORDbgSetInstruction: clear thumb bit of the address before flushing icache (#19409)
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>
Fri, 10 Aug 2018 23:10:53 +0000 (02:10 +0300)
committerJan Kotas <jkotas@microsoft.com>
Fri, 10 Aug 2018 23:10:53 +0000 (16:10 -0700)
We should clear thumb bit of the address before flushing icache otherwise
we may not flush the cache for the first byte of the instruction.

src/debug/inc/arm/primitives.h

index 512baf7..24779d7 100644 (file)
@@ -166,7 +166,7 @@ inline void CORDbgSetInstruction(CORDB_ADDRESS_TYPE* address,
 
     *(PRD_TYPE *)ptraddr = instruction;
     FlushInstructionCache(GetCurrentProcess(),
-                          address,
+                          _ClearThumbBit(address),
                           sizeof(PRD_TYPE));
 }