stacktrace.cc (13893:0e863b6c441a) | stacktrace.cc (14018:9d2153431f44) |
---|---|
1/* 2 * Copyright (c) 2004-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; --- 70 unchanged lines hidden (view full) --- 79std::string 80ProcessInfo::name(Addr ksp) const 81{ 82 Addr task = this->task(ksp); 83 if (!task) 84 return "console"; 85 86 char comm[256]; | 1/* 2 * Copyright (c) 2004-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; --- 70 unchanged lines hidden (view full) --- 79std::string 80ProcessInfo::name(Addr ksp) const 81{ 82 Addr task = this->task(ksp); 83 if (!task) 84 return "console"; 85 86 char comm[256]; |
87 CopyStringOut(tc, comm, task + name_off, sizeof(comm)); | 87 tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm)); |
88 if (!comm[0]) 89 return "startup"; 90 91 return comm; 92} 93 94StackTrace::StackTrace() 95 : tc(0), stack(64) --- 101 unchanged lines hidden (view full) --- 197bool 198StackTrace::decodePrologue(Addr sp, Addr callpc, Addr func, 199 int &size, Addr &ra) 200{ 201 size = 0; 202 ra = 0; 203 204 for (Addr pc = func; pc < callpc; pc += sizeof(MachInst)) { | 88 if (!comm[0]) 89 return "startup"; 90 91 return comm; 92} 93 94StackTrace::StackTrace() 95 : tc(0), stack(64) --- 101 unchanged lines hidden (view full) --- 197bool 198StackTrace::decodePrologue(Addr sp, Addr callpc, Addr func, 199 int &size, Addr &ra) 200{ 201 size = 0; 202 ra = 0; 203 204 for (Addr pc = func; pc < callpc; pc += sizeof(MachInst)) { |
205 MachInst inst; 206 CopyOut(tc, (uint8_t *)&inst, pc, sizeof(MachInst)); | 205 MachInst inst = tc->getVirtProxy().read<MachInst>(pc); |
207 208 int reg, disp; 209 if (decodeStack(inst, disp)) { 210 if (size) { 211 return true; 212 } 213 size += disp; 214 } else if (decodeSave(inst, reg, disp)) { 215 if (!ra && reg == ReturnAddressReg) { | 206 207 int reg, disp; 208 if (decodeStack(inst, disp)) { 209 if (size) { 210 return true; 211 } 212 size += disp; 213 } else if (decodeSave(inst, reg, disp)) { 214 if (!ra && reg == ReturnAddressReg) { |
216 CopyOut(tc, (uint8_t *)&ra, sp + disp, sizeof(Addr)); | 215 ra = tc->getVirtProxy().read<Addr>(sp + disp); |
217 if (!ra) { 218 return false; 219 } 220 } 221 } 222 } 223 224 return true; 225} 226 227#if TRACING_ON 228void 229StackTrace::dump() 230{ 231 panic("Stack trace dump not implemented.\n"); 232} 233#endif | 216 if (!ra) { 217 return false; 218 } 219 } 220 } 221 } 222 223 return true; 224} 225 226#if TRACING_ON 227void 228StackTrace::dump() 229{ 230 panic("Stack trace dump not implemented.\n"); 231} 232#endif |