summaryrefslogtreecommitdiff
path: root/src/arch/sparc/stacktrace.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2010-10-14 14:02:23 -0700
committerGabe Black <gblack@eecs.umich.edu>2010-10-14 14:02:23 -0700
commitb197a542b4e572d1e2df149642850fb9189c86c7 (patch)
tree19e909cfbf86fc1d6d91bb4269e473b0c569addc /src/arch/sparc/stacktrace.hh
parent930c653270b1523cbeb32a4b48d1fd08eaac6eb8 (diff)
downloadgem5-b197a542b4e572d1e2df149642850fb9189c86c7.tar.xz
SPARC: Get rid of the copy/pasted StackTrace stolen from Alpha.
Diffstat (limited to 'src/arch/sparc/stacktrace.hh')
-rw-r--r--src/arch/sparc/stacktrace.hh75
1 files changed, 6 insertions, 69 deletions
diff --git a/src/arch/sparc/stacktrace.hh b/src/arch/sparc/stacktrace.hh
index 929990fcb..24a70ed60 100644
--- a/src/arch/sparc/stacktrace.hh
+++ b/src/arch/sparc/stacktrace.hh
@@ -31,94 +31,31 @@
#ifndef __ARCH_SPARC_STACKTRACE_HH__
#define __ARCH_SPARC_STACKTRACE_HH__
-#include "base/trace.hh"
+#include <vector>
+
+#include "base/types.hh"
#include "cpu/static_inst.hh"
class ThreadContext;
namespace SparcISA
{
- class StackTrace;
-
- class ProcessInfo
- {
- private:
- ThreadContext *tc;
-
- int thread_info_size;
- int task_struct_size;
- int task_off;
- int pid_off;
- int name_off;
-
- public:
- ProcessInfo(ThreadContext *_tc);
-
- Addr task(Addr ksp) const;
- int pid(Addr ksp) const;
- std::string name(Addr ksp) const;
- };
-
class StackTrace
{
- protected:
- typedef SparcISA::MachInst MachInst;
private:
- ThreadContext *tc;
std::vector<Addr> stack;
- private:
- bool isEntry(Addr addr);
- bool decodePrologue(Addr sp, Addr callpc, Addr func, int &size, Addr &ra);
- bool decodeSave(MachInst inst, int &reg, int &disp);
- bool decodeStack(MachInst inst, int &disp);
-
- void trace(ThreadContext *tc, bool is_call);
-
public:
- StackTrace();
- StackTrace(ThreadContext *tc, StaticInstPtr inst);
- ~StackTrace();
-
- void clear()
+ bool trace(ThreadContext *tc, StaticInstPtr inst)
{
- tc = 0;
- stack.clear();
+ panic("StackTrace::trace not implemented for SPARC.\n");
+ return false;
}
- bool valid() const { return tc != NULL; }
- bool trace(ThreadContext *tc, StaticInstPtr inst);
-
- public:
const std::vector<Addr> &getstack() const { return stack; }
- static const int user = 1;
- static const int console = 2;
- static const int unknown = 3;
-
-#if TRACING_ON
- private:
- void dump();
-
- public:
- void dprintf() { if (DTRACE(Stack)) dump(); }
-#else
public:
void dprintf() {}
-#endif
};
-
- inline bool
- StackTrace::trace(ThreadContext *tc, StaticInstPtr inst)
- {
- if (!inst->isCall() && !inst->isReturn())
- return false;
-
- if (valid())
- clear();
-
- trace(tc, !inst->isReturn());
- return true;
- }
}
#endif // __ARCH_SPARC_STACKTRACE_HH__