Fixing stack traces, making lr BC... to diff from stack scribble BE...

This commit is contained in:
Ben Vanik 2015-05-20 23:28:34 -07:00
parent 5e5eb47789
commit ad72c193a6
5 changed files with 18 additions and 18 deletions

View File

@ -259,7 +259,7 @@ void X64CodeCache::InitializeUnwindEntry(uint8_t* unwind_entry_address,
unwind_info->Version = 1; unwind_info->Version = 1;
unwind_info->Flags = 0; unwind_info->Flags = 0;
unwind_info->SizeOfProlog = prolog_size; unwind_info->SizeOfProlog = prolog_size;
unwind_info->CountOfCodes = 3; unwind_info->CountOfCodes = 2;
unwind_info->FrameRegister = 0; unwind_info->FrameRegister = 0;
unwind_info->FrameOffset = 0; unwind_info->FrameOffset = 0;

View File

@ -235,13 +235,13 @@ bool X64Emitter::Emit(HIRBuilder* builder, size_t& out_stack_size) {
add(rsp, (uint32_t)stack_size); add(rsp, (uint32_t)stack_size);
ret(); ret();
#if XE_DEBUG if (FLAGS_debug) {
nop(); nop();
nop(); nop();
nop(); nop();
nop(); nop();
nop(); nop();
#endif // XE_DEBUG }
return true; return true;
} }
@ -253,13 +253,13 @@ void X64Emitter::MarkSourceOffset(const Instr* i) {
entry->code_offset = static_cast<uint32_t>(getSize()); entry->code_offset = static_cast<uint32_t>(getSize());
source_map_count_++; source_map_count_++;
#if XE_DEBUG if (FLAGS_debug) {
nop(); nop();
nop(); nop();
mov(eax, entry->source_offset); mov(eax, entry->source_offset);
nop(); nop();
nop(); nop();
#endif // XE_DEBUG }
if (debug_info_flags_ & DebugInfoFlags::kDebugInfoTraceFunctionCoverage) { if (debug_info_flags_ & DebugInfoFlags::kDebugInfoTraceFunctionCoverage) {
auto trace_data = debug_info_->trace_data(); auto trace_data = debug_info_->trace_data();

View File

@ -220,7 +220,7 @@ class TestRunner {
} }
auto ctx = thread_state->context(); auto ctx = thread_state->context();
ctx->lr = 0xBEBEBEBE; ctx->lr = 0xBCBCBCBC;
fn->Call(thread_state.get(), uint32_t(ctx->lr)); fn->Call(thread_state.get(), uint32_t(ctx->lr));
// Assert test state expectations. // Assert test state expectations.

View File

@ -338,7 +338,7 @@ bool Processor::Execute(ThreadState* thread_state, uint32_t address) {
// This could be set to anything to give us a unique identifier to track // This could be set to anything to give us a unique identifier to track
// re-entrancy/etc. // re-entrancy/etc.
uint64_t previous_lr = context->lr; uint64_t previous_lr = context->lr;
context->lr = 0xBEBEBEBE; context->lr = 0xBCBCBCBC;
// Execute the function. // Execute the function.
auto result = fn->Call(thread_state, uint32_t(context->lr)); auto result = fn->Call(thread_state, uint32_t(context->lr));

View File

@ -74,7 +74,7 @@ class TestFunction {
processor.get(), 0x100, ThreadStackType::kUserStack, stack_address, processor.get(), 0x100, ThreadStackType::kUserStack, stack_address,
stack_size, thread_state_address); stack_size, thread_state_address);
auto ctx = thread_state->context(); auto ctx = thread_state->context();
ctx->lr = 0xBEBEBEBE; ctx->lr = 0xBCBCBCBC;
pre_call(ctx); pre_call(ctx);