summaryrefslogtreecommitdiff
path: root/util/statetrace/tracechild.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-03-15 06:10:59 -0400
committerGabe Black <gblack@eecs.umich.edu>2007-03-15 06:10:59 -0400
commit47c8d9d3462db91cb296f8f42b2c401e736d4daa (patch)
treeafae4e40cabf985a27ba95c1fa75a2d9268c051e /util/statetrace/tracechild.cc
parent4379e54b52a6cefda4009b96a1a545973f3174c8 (diff)
parentb33f4623abeb82acf87714ada95682ceb0993d31 (diff)
downloadgem5-47c8d9d3462db91cb296f8f42b2c401e736d4daa.tar.xz
Merge zizzer.eecs.umich.edu:/bk/newmem
into zower.eecs.umich.edu:/home/gblack/m5/newmem-statetrace --HG-- extra : convert_revision : c886266320e6c1352e359d5abf6fb3a804f81451
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;
}