diff options
author | Zhicheng Zhu <zhizhu@microsoft.com> | 2015-08-31 20:03:00 -0700 |
---|---|---|
committer | Zhicheng Zhu <zhizhu@microsoft.com> | 2015-08-31 20:03:00 -0700 |
commit | 7c0a1e4c90c626d569a60a1431a48b0a620e51d5 (patch) | |
tree | 419e72826f675b8eb3e5a7f6ea75dcc272bc0d6d /src/unwinder | |
parent | 1d5dcc52c7a2661bbda732c98c511f4e6f2ce6f8 (diff) | |
download | coreclr-7c0a1e4c90c626d569a60a1431a48b0a620e51d5.tar.gz coreclr-7c0a1e4c90c626d569a60a1431a48b0a620e51d5.tar.bz2 coreclr-7c0a1e4c90c626d569a60a1431a48b0a620e51d5.zip |
The UPDATE_CONTEXT_POINTERS actually breaks lots of debuggers tests. The root problem is that when arm unwind the stack, we will call this function
hr = RtlpUnwindFunctionFull(pContext->Pc - (ULONG)ImageBase,
(ULONG)ImageBase,
&Rfe,
pContext,
&DummyEstablisherFrame,
&DummyHandlerRoutine,
&DummyHandlerData,
NULL); <-- UnwindParams
This will set UnwindParams as NULL, and eventually passed to UPDATE_CONTEXT_POINTERS and UPDATE_FP_CONTEXT_POINTERS in RtlpPopRegisterMask. This will generate the AV.
The fix is just simply checking the whether the Params is NULL or not.
[tfs-changeset: 1520758]
Diffstat (limited to 'src/unwinder')
-rw-r--r-- | src/unwinder/arm/unwinder_arm.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/src/unwinder/arm/unwinder_arm.cpp b/src/unwinder/arm/unwinder_arm.cpp index f257e1cfb2..8e65ea3b5c 100644 --- a/src/unwinder/arm/unwinder_arm.cpp +++ b/src/unwinder/arm/unwinder_arm.cpp @@ -20,27 +20,31 @@ #define STATUS_UNWIND_UNSUPPORTED_VERSION STATUS_UNSUCCESSFUL -#define UPDATE_CONTEXT_POINTERS(Params, RegisterNumber, Address) \ -do { \ - PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers = (Params)->ContextPointers; \ - if (ARGUMENT_PRESENT(ContextPointers)) { \ - if (RegisterNumber >= 4 && RegisterNumber <= 11) { \ - (&ContextPointers->R4)[RegisterNumber - 4] = (PULONG)Address; \ - } else if (RegisterNumber == 14) { \ - ContextPointers->Lr = (PULONG)Address; \ - } \ - } \ +#define UPDATE_CONTEXT_POINTERS(Params, RegisterNumber, Address) \ +do { \ + if (ARGUMENT_PRESENT(Params)) { \ + PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers = (Params)->ContextPointers; \ + if (ARGUMENT_PRESENT(ContextPointers)) { \ + if (RegisterNumber >= 4 && RegisterNumber <= 11) { \ + (&ContextPointers->R4)[RegisterNumber - 4] = (PULONG)Address; \ + } else if (RegisterNumber == 14) { \ + ContextPointers->Lr = (PULONG)Address; \ + } \ + } \ + } \ } while (0) -#define UPDATE_FP_CONTEXT_POINTERS(Params, RegisterNumber, Address) \ -do { \ - PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers = (Params)->ContextPointers; \ - if (ARGUMENT_PRESENT(ContextPointers) && \ - (RegisterNumber >= 8) && \ - (RegisterNumber <= 15)) { \ - \ - (&ContextPointers->D8)[RegisterNumber - 8] = (PULONGLONG)Address; \ - } \ +#define UPDATE_FP_CONTEXT_POINTERS(Params, RegisterNumber, Address) \ +do { \ + if (ARGUMENT_PRESENT(Params)) { \ + PT_KNONVOLATILE_CONTEXT_POINTERS ContextPointers = (Params)->ContextPointers; \ + if (ARGUMENT_PRESENT(ContextPointers) && \ + (RegisterNumber >= 8) && \ + (RegisterNumber <= 15)) { \ + \ + (&ContextPointers->D8)[RegisterNumber - 8] = (PULONGLONG)Address; \ + } \ + } \ } while (0) #define VALIDATE_STACK_ADDRESS(Params, Context, DataSize, Alignment, OutStatus) |