From: Gabe Black Date: Mon, 27 Jul 2009 07:54:04 +0000 (-0700) Subject: imported patch statetracehost.patch X-Git-Tag: Calvin_Submission~194^2~16 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1ad4de252852941fdde1838f007daeb34d1885c3;p=gem5.git imported patch statetracehost.patch --- 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;