stacktrace.cc (13888:6722ed2c817f) | stacktrace.cc (13893:0e863b6c441a) |
---|---|
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; --- 40 unchanged lines hidden (view full) --- 49{ 50 FSTranslatingPortProxy &vp = tc->getVirtProxy(); 51 SymbolTable *symtab = tc->getSystemPtr()->kernelSymtab; 52 53 Addr addr; 54 if (!symtab->findAddress(name, addr)) 55 panic("thread info not compiled into kernel\n"); 56 | 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; --- 40 unchanged lines hidden (view full) --- 49{ 50 FSTranslatingPortProxy &vp = tc->getVirtProxy(); 51 SymbolTable *symtab = tc->getSystemPtr()->kernelSymtab; 52 53 Addr addr; 54 if (!symtab->findAddress(name, addr)) 55 panic("thread info not compiled into kernel\n"); 56 |
57 return vp.readGtoH<int32_t>(addr); | 57 return vp.read<int32_t>(addr, GuestByteOrder); |
58} 59 60ProcessInfo::ProcessInfo(ThreadContext *_tc) : tc(_tc) 61{ 62 thread_info_size = readSymbol(tc, "thread_info_size"); 63 task_struct_size = readSymbol(tc, "task_struct_size"); 64 task_off = readSymbol(tc, "thread_info_task"); 65 pid_off = readSymbol(tc, "task_struct_pid"); --- 5 unchanged lines hidden (view full) --- 71{ 72 Addr base = ksp & ~0x1fff; 73 if (base == ULL(0xffffffffc0000000)) 74 return 0; 75 76 Addr tsk; 77 78 FSTranslatingPortProxy &vp = tc->getVirtProxy(); | 58} 59 60ProcessInfo::ProcessInfo(ThreadContext *_tc) : tc(_tc) 61{ 62 thread_info_size = readSymbol(tc, "thread_info_size"); 63 task_struct_size = readSymbol(tc, "task_struct_size"); 64 task_off = readSymbol(tc, "thread_info_task"); 65 pid_off = readSymbol(tc, "task_struct_pid"); --- 5 unchanged lines hidden (view full) --- 71{ 72 Addr base = ksp & ~0x1fff; 73 if (base == ULL(0xffffffffc0000000)) 74 return 0; 75 76 Addr tsk; 77 78 FSTranslatingPortProxy &vp = tc->getVirtProxy(); |
79 tsk = vp.readGtoH<Addr>(base + task_off); | 79 tsk = vp.read<Addr>(base + task_off, GuestByteOrder); |
80 81 return tsk; 82} 83 84int 85ProcessInfo::pid(Addr ksp) const 86{ 87 Addr task = this->task(ksp); 88 if (!task) 89 return -1; 90 91 uint16_t pd; 92 93 FSTranslatingPortProxy &vp = tc->getVirtProxy(); | 80 81 return tsk; 82} 83 84int 85ProcessInfo::pid(Addr ksp) const 86{ 87 Addr task = this->task(ksp); 88 if (!task) 89 return -1; 90 91 uint16_t pd; 92 93 FSTranslatingPortProxy &vp = tc->getVirtProxy(); |
94 pd = vp.readGtoH<uint16_t>(task + pid_off); | 94 pd = vp.read<uint16_t>(task + pid_off, GuestByteOrder); |
95 96 return pd; 97} 98 99std::string 100ProcessInfo::name(Addr ksp) const 101{ 102 Addr task = this->task(ksp); --- 70 unchanged lines hidden --- | 95 96 return pd; 97} 98 99std::string 100ProcessInfo::name(Addr ksp) const 101{ 102 Addr task = this->task(ksp); --- 70 unchanged lines hidden --- |