From bdbbc10b44c078b1738588d1a1b62ed1325dcd96 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 31 Dec 2012 22:52:34 -0500 Subject: [PATCH] Thread now also tracks the address of the last executed function. --- src/apps/debugger/model/Thread.cpp | 5 ++++- src/apps/debugger/model/Thread.h | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/apps/debugger/model/Thread.cpp b/src/apps/debugger/model/Thread.cpp index f289bca440..63d21e036f 100644 --- a/src/apps/debugger/model/Thread.cpp +++ b/src/apps/debugger/model/Thread.cpp @@ -18,6 +18,7 @@ Thread::Thread(Team* team, thread_id threadID) fID(threadID), fState(THREAD_STATE_UNKNOWN), fExecutedSubroutine(false), + fSubroutineAddress(0), fStoppedReason(THREAD_STOPPED_UNKNOWN), fCpuState(NULL), fStackTrace(NULL) @@ -70,6 +71,7 @@ Thread::SetState(uint32 state, uint32 reason, const BString& info) SetCpuState(NULL); SetStackTrace(NULL); fExecutedSubroutine = false; + fSubroutineAddress = 0; } fTeam->NotifyThreadStateChanged(this); @@ -113,8 +115,9 @@ Thread::SetStackTrace(StackTrace* trace) void -Thread::SetExecutedSubroutine() +Thread::SetExecutedSubroutine(target_addr_t address) { fExecutedSubroutine = true; + fSubroutineAddress = address; } diff --git a/src/apps/debugger/model/Thread.h b/src/apps/debugger/model/Thread.h index 8ac086192d..1cba07ff0c 100644 --- a/src/apps/debugger/model/Thread.h +++ b/src/apps/debugger/model/Thread.h @@ -11,6 +11,8 @@ #include #include +#include "types/Types.h" + class CpuState; class StackTrace; @@ -69,7 +71,9 @@ public: bool ExecutedSubroutine() const { return fExecutedSubroutine; } - void SetExecutedSubroutine(); + target_addr_t SubroutineAddress() const + { return fSubroutineAddress; } + void SetExecutedSubroutine(target_addr_t address); private: Team* fTeam; @@ -77,6 +81,7 @@ private: BString fName; uint32 fState; bool fExecutedSubroutine; + target_addr_t fSubroutineAddress; uint32 fStoppedReason; BString fStoppedReasonInfo; CpuState* fCpuState;