diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2009-07-27 00:54:04 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2009-07-27 00:54:04 -0700 |
commit | 1ad4de252852941fdde1838f007daeb34d1885c3 (patch) | |
tree | c569df3c8da3efa8b19e44f3b1b9de1545aa8c50 /util | |
parent | 081b6fe9db97bf3d9e49428dc5e19f27b141a642 (diff) | |
download | gem5-1ad4de252852941fdde1838f007daeb34d1885c3.tar.xz |
imported patch statetracehost.patch
Diffstat (limited to 'util')
-rw-r--r-- | util/statetrace/statetrace.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/util/statetrace/statetrace.cc b/util/statetrace/statetrace.cc index 824dfda69..2861bb29c 100644 --- a/util/statetrace/statetrace.cc +++ b/util/statetrace/statetrace.cc @@ -61,6 +61,7 @@ int main(int argc, char * argv[], char * envp[]) //Parse the command line arguments bool printInitial = false; bool printTrace = true; + string host = "localhost"; for(int x = 1; x < argc; x++) { if(!strcmp(argv[x], "-h")) @@ -68,6 +69,17 @@ int main(int argc, char * argv[], char * envp[]) printUsage(argv[0]); return 0; } + if(!strcmp(argv[x], "--host")) + { + x++; + if(x >= argc) + { + cerr << "Incorrect usage.\n" << endl; + printUsage(argv[0]); + return 1; + } + host = argv[x]; + } else if(!strcmp(argv[x], "-r")) { cout << "Legal register names:" << endl; @@ -127,7 +139,7 @@ int main(int argc, char * argv[], char * envp[]) return 1; } struct hostent *server; - server = gethostbyname("localhost"); + server = gethostbyname(host.c_str()); if(!server) { cerr << "Couldn't get host ip! " << strerror(errno) << endl; |