Fixed ARM single stepper: added "ADD Rn, PC" command emulation (dotnet/coreclr#24271)
authorKirill Frolov <k.frolov@samsung.com>
Wed, 22 May 2019 14:05:06 +0000 (17:05 +0300)
committerJan Kotas <jkotas@microsoft.com>
Wed, 22 May 2019 14:05:06 +0000 (07:05 -0700)
commit0a94ab0f10bfd335585bed32408130671a990434
treed68c31492531fa05739f4a72ba2056968d4bfab1
parenta0fac590c3f23df2ede09b6c811306003df83bc3
Fixed ARM single stepper: added "ADD Rn, PC" command emulation (dotnet/coreclr#24271)

This change fixes bug dotnet/coreclr#24164: pull request dotnet/coreclr#11366 adds generation of
commands which use PC-relative addressing. But ArmSingleStepper doesn't
implements support for "ADD Rn, PC" command, so when we try to debug
managed code, generated JIT can't be single stepped correctly.

Detailed changes description:

1) added "ADD Rn, PC" command emulation to ArmSingleStepper;
2) asserts added to JIT code generator, which prevents using of CPU
instructions, which address PC (R15) register with except of only "ADD
Rn, PC" instruction (asserts generated only in Debug builds).

Normally PC register shouldn't be used in arithmetic commands almost in
all cases.

Commit migrated from https://github.com/dotnet/coreclr/commit/aa66f12b58dc11857db5796ff49bd46dd242dd82
src/coreclr/src/jit/emitarm.cpp
src/coreclr/src/vm/arm/armsinglestepper.cpp