summaryrefslogtreecommitdiff
path: root/src/arch/arm/stacktrace.cc
diff options
context:
space:
mode:
authorAnthony Gutierrez <atgutier@umich.edu>2012-06-11 11:07:41 -0400
committerAnthony Gutierrez <atgutier@umich.edu>2012-06-11 11:07:41 -0400
commit9764cde7f2961116ac83f020f9c1598b00587ae0 (patch)
tree6febc12c4aca33541ca2072e1a3e7c3a368e64bb /src/arch/arm/stacktrace.cc
parent12ba92055d5222104873bae63f050f913ca00e21 (diff)
downloadgem5-9764cde7f2961116ac83f020f9c1598b00587ae0.tar.xz
ARM: implement the ProcessInfo methods
Diffstat (limited to 'src/arch/arm/stacktrace.cc')
-rw-r--r--src/arch/arm/stacktrace.cc33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/arch/arm/stacktrace.cc b/src/arch/arm/stacktrace.cc
index 99ebcd7c5..8575e1347 100644
--- a/src/arch/arm/stacktrace.cc
+++ b/src/arch/arm/stacktrace.cc
@@ -74,19 +74,46 @@ namespace ArmISA
Addr
ProcessInfo::task(Addr ksp) const
{
- return 0;
+ Addr base = ksp & ~0x1fff;
+ if (base == ULL(0xffffffffc0000000))
+ return 0;
+
+ Addr tsk;
+
+ FSTranslatingPortProxy &vp = tc->getVirtProxy();
+ tsk = vp.readGtoH<Addr>(base + task_off);
+
+ return tsk;
}
int
ProcessInfo::pid(Addr ksp) const
{
- return -1;
+ Addr task = this->task(ksp);
+ if (!task)
+ return -1;
+
+ uint16_t pd;
+
+ FSTranslatingPortProxy &vp = tc->getVirtProxy();
+ pd = vp.readGtoH<uint16_t>(task + pid_off);
+
+ return pd;
}
string
ProcessInfo::name(Addr ksp) const
{
- return "Implement me";
+ Addr task = this->task(ksp);
+ if (!task)
+ return "unknown";
+
+ char comm[256];
+ CopyStringOut(tc, comm, task + name_off, sizeof(comm));
+ if (!comm[0])
+ return "startup";
+
+ return comm;
}
StackTrace::StackTrace()