summaryrefslogtreecommitdiff
path: root/util/statetrace/tracechild.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-03-15 06:10:50 -0400
committerGabe Black <gblack@eecs.umich.edu>2007-03-15 06:10:50 -0400
commitb33f4623abeb82acf87714ada95682ceb0993d31 (patch)
tree80144e7e7717352d5627e5ca2eb5e2eb9da9a30c /util/statetrace/tracechild.cc
parentff90b8c1aa99711eeb55c5eba29519f77cbc041c (diff)
downloadgem5-b33f4623abeb82acf87714ada95682ceb0993d31.tar.xz
Update to statetrace. This will break it, but I want to make sure it gets into mercurial.
--HG-- extra : convert_revision : 6960d2f728c85e99e32bf9b752e45b3cb5e30e3e
Diffstat (limited to 'util/statetrace/tracechild.cc')
-rw-r--r--util/statetrace/tracechild.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/util/statetrace/tracechild.cc b/util/statetrace/tracechild.cc
index 130f9690f..603429829 100644
--- a/util/statetrace/tracechild.cc
+++ b/util/statetrace/tracechild.cc
@@ -51,12 +51,23 @@ bool TraceChild::startTracing(const char * pathToFile, char * const argv[])
//program to trace.
//Let our parent trace us
- ptrace(PTRACE_TRACEME, 0, 0, 0);
+ if(ptrace(PTRACE_TRACEME, 0, 0, 0) == -1)
+ {
+ cout << "Failure calling TRACEME\n";
+ cout << strerror(errno) << endl;
+ return false;
+ }
+
+ //Set up an empty environment for the child...
+ //We would want to specify this somehow at some point
+ char * env[] = {NULL};
//Start the program to trace
- execv(pathToFile, argv);
+ execve(pathToFile, argv, env);
//We should never get here, so this is an error!
+ cout << "Exec failed\n";
+ cout << strerror(errno) << endl;
return false;
}