changeset f61a3b66a5f5 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=f61a3b66a5f5
description:
        imported patch statetracehost.patch

diffstat:

1 file changed, 13 insertions(+), 1 deletion(-)
util/statetrace/statetrace.cc |   14 +++++++++++++-

diffs (38 lines):

diff -r 10f05e881153 -r f61a3b66a5f5 util/statetrace/statetrace.cc
--- a/util/statetrace/statetrace.cc     Mon Jul 27 00:53:39 2009 -0700
+++ b/util/statetrace/statetrace.cc     Mon Jul 27 00:54:04 2009 -0700
@@ -61,6 +61,7 @@
     //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 @@
             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 @@
             return 1;
         }
         struct hostent *server;
-        server = gethostbyname("localhost");
+        server = gethostbyname(host.c_str());
         if(!server)
         {
             cerr << "Couldn't get host ip! " << strerror(errno) << endl;
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to