#define DPRINTFR(x, args...) \
do { \
if (Trace::IsOn(Trace::x)) \
- __dprintf((Tick)-1, string(), args, cp::ArgListNull()); \
+ __dprintf((Tick)-1, std::string(), args, cp::ArgListNull()); \
} while (0)
#define DPRINTFN(args...) \
unimplementedFunc(SyscallDesc *desc, int callnum, Process *process,
ExecContext *xc)
{
- cerr << "Error: syscall " << desc->name
- << " (#" << callnum << ") unimplemented.";
- cerr << " Args: " << xc->getSyscallArg(0) << ", " << xc->getSyscallArg(1)
- << ", ..." << endl;
-
- abort();
+ fatal("syscall %s (#%d) unimplemented.", desc->name, callnum);
}
ignoreFunc(SyscallDesc *desc, int callnum, Process *process,
ExecContext *xc)
{
- DCOUT(SyscallWarnings) << "Warning: ignoring syscall " << desc->name
- << "(" << xc->getSyscallArg(0)
- << ", " << xc->getSyscallArg(1)
- << ", ...)" << endl;
+ warn("ignoring syscall %s(%d, %d, ...)", desc->name,
+ xc->getSyscallArg(0), xc->getSyscallArg(1));
return 0;
}
int fd = xc->getSyscallArg(0);
unsigned req = xc->getSyscallArg(1);
- // DPRINTFR(SyscallVerbose, "ioctl(%d, 0x%x, ...)\n", fd, req);
+ DPRINTF(SyscallVerbose, "ioctl(%d, 0x%x, ...)\n", fd, req);
if (fd < 0 || process->sim_fd(fd) < 0) {
// doesn't map to any simulator fd: not a valid target fd
{
int fd = process->sim_fd(xc->getSyscallArg(0));
- // DPRINTFR(SyscallVerbose, "fstat(%d, ...)\n", fd);
+ DPRINTF(SyscallVerbose, "fstat(%d, ...)\n", fd);
if (fd < 0)
return -EBADF;
}
if (!(flags & OS::TGT_MAP_ANONYMOUS)) {
- DPRINTF(SyscallWarnings, "Warning: allowing mmap of file @ fd %d. "
- "This will break if not /dev/zero.", xc->getSyscallArg(4));
+ warn("allowing mmap of file @ fd %d. "
+ "This will break if not /dev/zero.", xc->getSyscallArg(4));
}
return start;
if (who != OS::RUSAGE_SELF) {
// don't really handle THREAD or CHILDREN, but just warn and
// plow ahead
- DCOUT(SyscallWarnings)
- << "Warning: getrusage() only supports RUSAGE_SELF."
- << " Parameter " << who << " ignored." << std::endl;
+ warn("getrusage() only supports RUSAGE_SELF. Parameter %d ignored.",
+ who);
}
getElapsedTime(rup->ru_utime.tv_sec, rup->ru_utime.tv_usec);