stacktrace.cc (4172:141705d83494) stacktrace.cc (5499:8bfc7650c344)
1/*
2 * Copyright (c) 2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 57 unchanged lines hidden (view full) ---

66
67 if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_pid", addr))
68 panic("thread info not compiled into kernel\n");
69 pid_off = vp->readGtoH<int32_t>(addr);
70
71 if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr))
72 panic("thread info not compiled into kernel\n");
73 name_off = vp->readGtoH<int32_t>(addr);
1/*
2 * Copyright (c) 2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 57 unchanged lines hidden (view full) ---

66
67 if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_pid", addr))
68 panic("thread info not compiled into kernel\n");
69 pid_off = vp->readGtoH<int32_t>(addr);
70
71 if (!tc->getSystemPtr()->kernelSymtab->findAddress("task_struct_comm", addr))
72 panic("thread info not compiled into kernel\n");
73 name_off = vp->readGtoH<int32_t>(addr);
74
75 tc->delVirtPort(vp);
76 }
77
78 Addr
79 ProcessInfo::task(Addr ksp) const
80 {
81 Addr base = ksp & ~0x3fff;
82 if (base == ULL(0xfffffc0000000000))
83 return 0;
84
85 Addr tsk;
86
87 VirtualPort *vp;
88
89 vp = tc->getVirtPort();
90 tsk = vp->readGtoH<Addr>(base + task_off);
74 }
75
76 Addr
77 ProcessInfo::task(Addr ksp) const
78 {
79 Addr base = ksp & ~0x3fff;
80 if (base == ULL(0xfffffc0000000000))
81 return 0;
82
83 Addr tsk;
84
85 VirtualPort *vp;
86
87 vp = tc->getVirtPort();
88 tsk = vp->readGtoH<Addr>(base + task_off);
91 tc->delVirtPort(vp);
92
93 return tsk;
94 }
95
96 int
97 ProcessInfo::pid(Addr ksp) const
98 {
99 Addr task = this->task(ksp);
100 if (!task)
101 return -1;
102
103 uint16_t pd;
104
105 VirtualPort *vp;
106
107 vp = tc->getVirtPort();
108 pd = vp->readGtoH<uint16_t>(task + pid_off);
89
90 return tsk;
91 }
92
93 int
94 ProcessInfo::pid(Addr ksp) const
95 {
96 Addr task = this->task(ksp);
97 if (!task)
98 return -1;
99
100 uint16_t pd;
101
102 VirtualPort *vp;
103
104 vp = tc->getVirtPort();
105 pd = vp->readGtoH<uint16_t>(task + pid_off);
109 tc->delVirtPort(vp);
110
111 return pd;
112 }
113
114 string
115 ProcessInfo::name(Addr ksp) const
116 {
117 Addr task = this->task(ksp);

--- 253 unchanged lines hidden ---
106
107 return pd;
108 }
109
110 string
111 ProcessInfo::name(Addr ksp) const
112 {
113 Addr task = this->task(ksp);

--- 253 unchanged lines hidden ---