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; --- 90 unchanged lines hidden (view full) --- 99std::string 100ProcessInfo::name(Addr ksp) const 101{ 102 Addr task = this->task(ksp); 103 if (!task) 104 return "console"; 105 106 char comm[256]; |
107 tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm)); |
108 if (!comm[0]) 109 return "startup"; 110 111 return comm; 112} 113 114StackTrace::StackTrace() 115 : tc(0), stack(64) --- 43 unchanged lines hidden (view full) --- 159bool 160StackTrace::decodePrologue(Addr sp, Addr callpc, Addr func, 161 int &size, Addr &ra) 162{ 163 size = 0; 164 ra = 0; 165 166 for (Addr pc = func; pc < callpc; pc += sizeof(MachInst)) { |
167 MachInst inst = tc->getVirtProxy().read<MachInst>(pc); |
168 169 int reg, disp; 170 if (decodeStack(inst, disp)) { 171 if (size) { 172 // panic("decoding frame size again"); 173 return true; 174 } 175 size += disp; 176 } else if (decodeSave(inst, reg, disp)) { 177 if (!ra && reg == ReturnAddressReg) { |
178 ra = tc->getVirtProxy().read<Addr>(sp + disp); |
179 if (!ra) { 180 // panic("no return address value pc=%#x\n", pc); 181 return false; 182 } 183 } 184 } 185 } 186 --- 30 unchanged lines hidden --- |