return "console";
char comm[256];
- CopyStringOut(tc, comm, task + name_off, sizeof(comm));
+ tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm));
if (!comm[0])
return "startup";
ra = 0;
for (Addr pc = func; pc < callpc; pc += sizeof(MachInst)) {
- MachInst inst;
- CopyOut(tc, (uint8_t *)&inst, pc, sizeof(MachInst));
+ MachInst inst = tc->getVirtProxy().read<MachInst>(pc);
int reg, disp;
if (decodeStack(inst, disp)) {
size += disp;
} else if (decodeSave(inst, reg, disp)) {
if (!ra && reg == ReturnAddressReg) {
- CopyOut(tc, (uint8_t *)&ra, sp + disp, sizeof(Addr));
+ ra = tc->getVirtProxy().read<Addr>(sp + disp);
if (!ra) {
// panic("no return address value pc=%#x\n", pc);
return false;
return "unknown";
char comm[256];
- CopyStringOut(tc, comm, task + name_off, sizeof(comm));
+ tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm));
if (!comm[0])
return "startup";
return false;
}
- CopyOut(tc, &data, addr, sizeof(T));
-
- data = TheISA::gtoh(data);
+ data = tc->getVirtProxy().read<T>(addr, TheISA::GuestByteOrder);
return true;
}
// Note that in Linux 4.10 the thread_info struct will no longer have a
// pointer to the task_struct for arm64. See:
// https://patchwork.kernel.org/patch/9333699/
- int32_t offset;
+ int32_t offset = 0;
if (!get_data("thread_info_task", offset))
return 0;
if (!thread_info)
thread_info = curThreadInfo();
- Addr addr;
- CopyOut(tc, &addr, thread_info + offset, sizeof(addr));
-
- return addr;
+ return tc->getVirtProxy().read<Addr>(thread_info + offset);
}
int32_t
curTaskPIDFromTaskStruct(Addr task_struct) {
- int32_t offset;
+ int32_t offset = 0;
if (!get_data("task_struct_pid", offset))
return -1;
- int32_t pid;
- CopyOut(tc, &pid, task_struct + offset, sizeof(pid));
-
- return pid;
+ return tc->getVirtProxy().read<int32_t>(task_struct + offset);
}
int32_t
int32_t
curTaskTGIDFromTaskStruct(Addr task_struct)
{
- int32_t offset;
+ int32_t offset = 0;
if (!get_data("task_struct_tgid", offset))
return -1;
- int32_t tgid;
- CopyOut(tc, &tgid, task_struct + offset, sizeof(tgid));
-
- return tgid;
+ return tc->getVirtProxy().read<int32_t>(task_struct + offset);
}
int32_t
int64_t
curTaskStartFromTaskStruct(Addr task_struct)
{
- int32_t offset;
+ int32_t offset = 0;
if (!get_data("task_struct_start_time", offset))
return -1;
- int64_t data;
// start_time is actually of type timespec, but if we just
// grab the first long, we'll get the seconds out of it
- CopyOut(tc, &data, task_struct + offset, sizeof(data));
-
- return data;
+ return tc->getVirtProxy().read<int64_t>(task_struct + offset);
}
int64_t
std::string
curTaskNameFromTaskStruct(Addr task_struct)
{
- int32_t offset;
- int32_t size;
+ int32_t offset = 0;
+ int32_t size = 0;
if (!get_data("task_struct_comm", offset))
return "FailureIn_curTaskName";
return "FailureIn_curTaskName";
char buffer[size + 1];
- CopyStringOut(tc, buffer, task_struct + offset, size);
+ tc->getVirtProxy().readString(buffer, task_struct + offset, size);
return buffer;
}
if (!get_data("task_struct_mm", offset))
return -1;
- int32_t mm_ptr;
- CopyOut(tc, &mm_ptr, task_struct + offset, sizeof(mm_ptr));
-
- return mm_ptr;
+ return tc->getVirtProxy().read<int32_t>(task_struct + offset);
}
int32_t
return "console";
char comm[256];
- CopyStringOut(tc, comm, task + name_off, sizeof(comm));
+ tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm));
if (!comm[0])
return "startup";
ra = 0;
for (Addr pc = func; pc < callpc; pc += sizeof(MachInst)) {
- MachInst inst;
- CopyOut(tc, (uint8_t *)&inst, pc, sizeof(MachInst));
+ MachInst inst = tc->getVirtProxy().read<MachInst>(pc);
int reg, disp;
if (decodeStack(inst, disp)) {
size += disp;
} else if (decodeSave(inst, reg, disp)) {
if (!ra && reg == ReturnAddressReg) {
- CopyOut(tc, (uint8_t *)&ra, sp + disp, sizeof(Addr));
+ ra = tc->getVirtProxy().read<Addr>(sp + disp);
if (!ra) {
return false;
}
return "console";
char comm[256];
- CopyStringOut(tc, comm, task + name_off, sizeof(comm));
+ tc->getVirtProxy().readString(comm, task + name_off, sizeof(comm));
if (!comm[0])
return "startup";
ra = 0;
for (Addr pc = func; pc < callpc; pc += sizeof(MachInst)) {
- MachInst inst;
- CopyOut(tc, (uint8_t *)&inst, pc, sizeof(MachInst));
+ MachInst inst = tc->getVirtProxy().read<MachInst>(pc);
int reg, disp;
if (decodeStack(inst, disp)) {
size += disp;
} else if (decodeSave(inst, reg, disp)) {
if (!ra && reg == ReturnAddressReg) {
- CopyOut(tc, (uint8_t *)&ra, sp + disp, sizeof(Addr));
+ ra = tc->getVirtProxy().read<Addr>(sp + disp);
if (!ra) {
// panic("no return address value pc=%#x\n", pc);
return false;
debugSymbolTable->findNearestSymbol(
tc->readIntReg(ReturnAddressReg), st, junk);
- CopyStringOut(tc, sm, args[0], 50);
+ tc->getVirtProxy().readString(sm, args[0], 50);
System *sys = tc->getSystemPtr();
StringWrap name(sys->name());
Arguments args(tc);
char sm[50];
- CopyStringOut(tc, sm, args[0], 50);
+ tc->getVirtProxy().readString(sm, args[0], 50);
System *sys = tc->getSystemPtr();
doSwSmEnd(sys, tc->contextId(), sm, getFrame(tc));
}
Arguments args(tc);
char st[50];
- CopyStringOut(tc, st, args[1], 50);
+ tc->getVirtProxy().readString(st, args[1], 50);
StringWrap name(tc->getSystemPtr()->name());
DPRINTF(Annotate, "Explict begin of state %s\n", st);
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
int32_t count = args[2];
System *sys = tc->getSystemPtr();
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
int32_t count = args[2];
System *sys = tc->getSystemPtr();
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
System *sys = tc->getSystemPtr();
int32_t count = args[2];
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
System *sys = tc->getSystemPtr();
int32_t count = args[2];
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
System *sys = tc->getSystemPtr();
int32_t count = args[3];
if (!!args[2]) {
char sm[50];
- CopyStringOut(tc, sm, args[2], 50);
+ tc->getVirtProxy().readString(sm, args[2], 50);
doSwSmEnd(tc->getSystemPtr(), tc->contextId(), sm, getFrame(tc));
}
}
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
System *sys = tc->getSystemPtr();
int32_t count = args[3];
if (!!args[2]) {
char sm[50];
- CopyStringOut(tc, sm, args[2], 50);
+ tc->getVirtProxy().readString(sm, args[2], 50);
doSwSmEnd(tc->getSystemPtr(), tc->contextId(), sm, getFrame(tc));
}
}
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
System *sys = tc->getSystemPtr();
StringWrap name(sys->name());
int32_t size = args[2];
char q[50];
Arguments args(tc);
uint64_t id = args[0];
- CopyStringOut(tc, q, args[1], 50);
+ tc->getVirtProxy().readString(q, args[1], 50);
System *sys = tc->getSystemPtr();
StringWrap name(sys->name());
int32_t size = args[2];
char lsm[50];
Arguments args(tc);
- CopyStringOut(tc, lsm, args[0], 50);
+ tc->getVirtProxy().readString(lsm, args[0], 50);
System *sys = tc->getSystemPtr();
StringWrap name(sys->name());
if (!!args[2]) {
char sm[50];
- CopyStringOut(tc, sm, args[2], 50);
+ tc->getVirtProxy().readString(sm, args[2], 50);
doSwSmEnd(tc->getSystemPtr(), tc->contextId(), sm, getFrame(tc));
}
}
char lsm[50];
Arguments args(tc);
- CopyStringOut(tc, lsm, args[0], 50);
+ tc->getVirtProxy().readString(lsm, args[0], 50);
System *sys = tc->getSystemPtr();
StringWrap name(sys->name());
int sysi = getSys(sys);
if (!!args[1]) {
char sm[50];
- CopyStringOut(tc, sm, args[1], 50);
+ tc->getVirtProxy().readString(sm, args[1], 50);
doSwSmEnd(tc->getSystemPtr(), tc->contextId(), sm, getFrame(tc));
}
}
#include <cassert>
#include <memory>
+#include "cpu/thread_context.hh"
#include "mem/fs_translating_port_proxy.hh"
-class ThreadContext;
-
class Arguments
{
protected:
template <class T>
operator T *() {
T *buf = (T *)data->alloc(sizeof(T));
- CopyOut(tc, buf, getArg(sizeof(T)), sizeof(T));
+ tc->getVirtProxy().readBlob(getArg(sizeof(T)), buf, sizeof(T));
return buf;
}
operator char *() {
char *buf = data->alloc(2048);
- CopyStringOut(tc, buf, getArg(), 2048);
+ tc->getVirtProxy().readString(buf, getArg(), 2048);
return buf;
}
};
if (!FullSystem)
panicFsOnlyPseudoInst("addSymbol");
- char symb[100];
- CopyStringOut(tc, symb, symbolAddr, 100);
- std::string symbol(symb);
+ std::string symbol;
+ tc->getVirtProxy().readString(symbol, symbolAddr);
DPRINTF(Loader, "Loaded symbol: %s @ %#llx\n", symbol, addr);
}
close(fd);
- CopyIn(tc, vaddr, buf, result);
+ tc->getVirtProxy().writeBlob(vaddr, buf, result);
delete [] buf;
return result;
}
vaddr, len, offset, filename_addr);
// copy out target filename
- char fn[100];
std::string filename;
- CopyStringOut(tc, fn, filename_addr, 100);
- filename = std::string(fn);
+ tc->getVirtProxy().readString(filename, filename_addr);
OutputStream *out;
if (offset == 0) {
// copy out data and write to file
char *buf = new char[len];
- CopyOut(tc, buf, vaddr, len);
+ tc->getVirtProxy().readBlob(vaddr, buf, len);
os->write(buf, len);
if (os->fail() || os->bad())
panic("Error while doing writefile!\n");