From 0bcb2902ec21393d71c94e63aa6733cb5311a0cc Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Tue, 17 Jun 2014 15:52:45 +0200 Subject: Revert "Revert "Fix access to FP registers when visiting stack"" This reverts commit 8ebd94ab2e0d9867a7d384f00fa4cab24235216f. Fixes StackVisitor::GetVReg to read register value in a uintptr_t local and cast it into uint32_t pointer argument. Bug: 15433097 Change-Id: I4e13ed5446e823e9ec50fbc378b16be5b17b2294 --- runtime/stack.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'runtime/stack.h') diff --git a/runtime/stack.h b/runtime/stack.h index 199111563f..9402cddf56 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -561,15 +561,21 @@ class StackVisitor { bool GetNextMethodAndDexPc(mirror::ArtMethod** next_method, uint32_t* next_dex_pc) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - uint32_t GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind) const + bool GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind, uint32_t* val) const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); - void SetVReg(mirror::ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind) + uint32_t GetVReg(mirror::ArtMethod* m, uint16_t vreg, VRegKind kind) const + SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { + uint32_t val; + bool success = GetVReg(m, vreg, kind, &val); + CHECK(success) << "Failed to read vreg " << vreg << " of kind " << kind; + return val; + } + + bool SetVReg(mirror::ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); uintptr_t* GetGPRAddress(uint32_t reg) const; - uintptr_t GetGPR(uint32_t reg) const; - void SetGPR(uint32_t reg, uintptr_t value); // This is a fast-path for getting/setting values in a quick frame. uint32_t* GetVRegAddr(StackReference* cur_quick_frame, @@ -700,6 +706,11 @@ class StackVisitor { StackVisitor(Thread* thread, Context* context, size_t num_frames) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); + bool GetGPR(uint32_t reg, uintptr_t* val) const; + bool SetGPR(uint32_t reg, uintptr_t value); + bool GetFPR(uint32_t reg, uintptr_t* val) const; + bool SetFPR(uint32_t reg, uintptr_t value); + instrumentation::InstrumentationStackFrame& GetInstrumentationStackFrame(uint32_t depth) const; void SanityCheckFrame() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_); -- cgit v1.2.3-59-g8ed1b