Hello Anouk Van Laer,

I'd like you to do a code review. Please visit

    https://gem5-review.googlesource.com/10026

to review the following change.


Change subject: base, dev: Fix port message for vnc and terminal
......................................................................

base, dev: Fix port message for vnc and terminal

When running gem5, the simulator outputs the following message to
describe the ports used by the VNC server and ther terminal:

Listening for system connection on port 5900
Listening for system connection on port 3456

The code used to extract the basename ('terminal' or 'vncserver') and
print that instead of system. However, this doesn't seem to work any
more. Change the code to output the full object name instead.

Change-Id: Ib27f66a5f8ba64c7a875b4e2f26a2e2ff48db8f3
Signed-off-by: Andreas Sandberg <andreas.sandb...@arm.com>
Reviewed-by: Anouk Van Laer <anouk.vanl...@arm.com>
---
M src/base/vnc/vncserver.cc
M src/dev/serial/terminal.cc
2 files changed, 4 insertions(+), 10 deletions(-)



diff --git a/src/base/vnc/vncserver.cc b/src/base/vnc/vncserver.cc
index 97515ac..a37f1dd 100644
--- a/src/base/vnc/vncserver.cc
+++ b/src/base/vnc/vncserver.cc
@@ -174,11 +174,8 @@
         port++;
     }

-    int p1, p2;
-    p2 = name().rfind('.') - 1;
-    p1 = name().rfind('.', p2);
-    ccprintf(cerr, "Listening for %s connection on port %d\n",
-             name().substr(p1 + 1, p2 - p1), port);
+    ccprintf(cerr, "%s: Listening for connections on port %d\n",
+             name(), port);

     listenEvent = new ListenEvent(this, listener.getfd(), POLLIN);
     pollQueue.schedule(listenEvent);
diff --git a/src/dev/serial/terminal.cc b/src/dev/serial/terminal.cc
index 5e8e52e..bc8c14c 100644
--- a/src/dev/serial/terminal.cc
+++ b/src/dev/serial/terminal.cc
@@ -153,11 +153,8 @@
         port++;
     }

-    int p1, p2;
-    p2 = name().rfind('.') - 1;
-    p1 = name().rfind('.', p2);
-    ccprintf(cerr, "Listening for %s connection on port %d\n",
-            name().substr(p1+1,p2-p1), port);
+    ccprintf(cerr, "%s: Listening for connections on port %d\n",
+             name(), port);

     listenEvent = new ListenEvent(this, listener.getfd(), POLLIN);
     pollQueue.schedule(listenEvent);

--
To view, visit https://gem5-review.googlesource.com/10026
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ib27f66a5f8ba64c7a875b4e2f26a2e2ff48db8f3
Gerrit-Change-Number: 10026
Gerrit-PatchSet: 1
Gerrit-Owner: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Anouk Van Laer <anouk.vanl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to