From 73ef8bd168795855cd23e56dd6739dfa23a77eb8 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Mon, 6 Aug 2012 16:55:34 -0700 Subject: process: add progName() virtual function This replaces a (potentially uninitialized) string field with a virtual function so that we can have a safe interface without requiring changes to the eio code. --- src/sim/process.hh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/sim/process.hh') diff --git a/src/sim/process.hh b/src/sim/process.hh index cddd060fd..be4c53dd9 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -110,11 +110,8 @@ class Process : public SimObject Addr nxm_start; Addr nxm_end; - std::string prog_fname; // file name - Stats::Scalar num_syscalls; // number of syscalls executed - protected: // constructor Process(ProcessParams *params); @@ -177,6 +174,9 @@ class Process : public SimObject // Find a free context to use ThreadContext *findFreeContext(); + // provide program name for debug messages + virtual const char *progName() const { return ""; } + // map simulator fd sim_fd to target fd tgt_fd void dup_fd(int sim_fd, int tgt_fd); @@ -292,6 +292,9 @@ class LiveProcess : public Process inline uint64_t pid() {return __pid;} inline uint64_t ppid() {return __ppid;} + // provide program name for debug messages + virtual const char *progName() const { return argv[0].c_str(); } + std::string fullPath(const std::string &filename) { -- cgit v1.2.3