stacktrace.cc (5567:8fc3b004b0df) stacktrace.cc (5568:d14250d688d2)
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;

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

137 {
138 }
139
140 void
141 StackTrace::trace(ThreadContext *_tc, bool is_call)
142 {
143 tc = _tc;
144
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;

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

137 {
138 }
139
140 void
141 StackTrace::trace(ThreadContext *_tc, bool is_call)
142 {
143 tc = _tc;
144
145 bool usermode = (tc->readMiscRegNoEffect(AlphaISA::IPR_DTB_CM) & 0x18) != 0;
145 bool usermode = (tc->readMiscRegNoEffect(IPR_DTB_CM) & 0x18) != 0;
146
147 Addr pc = tc->readNextPC();
148 bool kernel = tc->getSystemPtr()->kernelStart <= pc &&
149 pc <= tc->getSystemPtr()->kernelEnd;
150
151 if (usermode) {
152 stack.push_back(user);
153 return;
154 }
155
156 if (!kernel) {
157 stack.push_back(console);
158 return;
159 }
160
161 SymbolTable *symtab = tc->getSystemPtr()->kernelSymtab;
146
147 Addr pc = tc->readNextPC();
148 bool kernel = tc->getSystemPtr()->kernelStart <= pc &&
149 pc <= tc->getSystemPtr()->kernelEnd;
150
151 if (usermode) {
152 stack.push_back(user);
153 return;
154 }
155
156 if (!kernel) {
157 stack.push_back(console);
158 return;
159 }
160
161 SymbolTable *symtab = tc->getSystemPtr()->kernelSymtab;
162 Addr ksp = tc->readIntReg(AlphaISA::StackPointerReg);
162 Addr ksp = tc->readIntReg(StackPointerReg);
163 Addr bottom = ksp & ~0x3fff;
164 Addr addr;
165
166 if (is_call) {
167 if (!symtab->findNearestAddr(pc, addr))
168 panic("could not find address %#x", pc);
169
170 stack.push_back(addr);

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

210 }
211
212 panic("unwinding too far");
213 }
214
215 bool
216 StackTrace::isEntry(Addr addr)
217 {
163 Addr bottom = ksp & ~0x3fff;
164 Addr addr;
165
166 if (is_call) {
167 if (!symtab->findNearestAddr(pc, addr))
168 panic("could not find address %#x", pc);
169
170 stack.push_back(addr);

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

210 }
211
212 panic("unwinding too far");
213 }
214
215 bool
216 StackTrace::isEntry(Addr addr)
217 {
218 if (addr == tc->readMiscRegNoEffect(AlphaISA::IPR_PALtemp12))
218 if (addr == tc->readMiscRegNoEffect(IPR_PALtemp12))
219 return true;
220
219 return true;
220
221 if (addr == tc->readMiscRegNoEffect(AlphaISA::IPR_PALtemp7))
221 if (addr == tc->readMiscRegNoEffect(IPR_PALtemp7))
222 return true;
223
222 return true;
223
224 if (addr == tc->readMiscRegNoEffect(AlphaISA::IPR_PALtemp11))
224 if (addr == tc->readMiscRegNoEffect(IPR_PALtemp11))
225 return true;
226
225 return true;
226
227 if (addr == tc->readMiscRegNoEffect(AlphaISA::IPR_PALtemp21))
227 if (addr == tc->readMiscRegNoEffect(IPR_PALtemp21))
228 return true;
229
228 return true;
229
230 if (addr == tc->readMiscRegNoEffect(AlphaISA::IPR_PALtemp9))
230 if (addr == tc->readMiscRegNoEffect(IPR_PALtemp9))
231 return true;
232
231 return true;
232
233 if (addr == tc->readMiscRegNoEffect(AlphaISA::IPR_PALtemp2))
233 if (addr == tc->readMiscRegNoEffect(IPR_PALtemp2))
234 return true;
235
236 return false;
237 }
238
239 bool
240 StackTrace::decodeStack(MachInst inst, int &disp)
241 {

--- 125 unchanged lines hidden ---
234 return true;
235
236 return false;
237 }
238
239 bool
240 StackTrace::decodeStack(MachInst inst, int &disp)
241 {

--- 125 unchanged lines hidden ---