summaryrefslogtreecommitdiff
path: root/src/base/remote_gdb.cc
diff options
context:
space:
mode:
authorJose Marinho <jose.marinho@arm.com>2017-06-28 11:09:13 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-07-12 12:29:32 +0000
commitc2baaab0ed43ad09fc8b7fcda25207b6ccd6c0e3 (patch)
tree224509c2ab0f21168001ce5f14160eb61e09d9ce /src/base/remote_gdb.cc
parenteef537fd993f7a879a44f5786bc528e03b0e61bc (diff)
downloadgem5-c2baaab0ed43ad09fc8b7fcda25207b6ccd6c0e3.tar.xz
cpu, sim: Add param to force CPUs to wait for GDB
By setting the BaseCPU parameter wait_for_dbg_connection, the GDB server blocks during initialisation waiting for the remote debugger to connect before starting the simulated CPU. Change-Id: I4d62c68ce9adf69344bccbb44f66e30b33715a1c [ Update info message to include remote GDB port, rename param. ] Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/3963 Reviewed-by: Gabe Black <gabeblack@google.com> Reviewed-by: Anthony Gutierrez <anthony.gutierrez@amd.com>
Diffstat (limited to 'src/base/remote_gdb.cc')
-rw-r--r--src/base/remote_gdb.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc
index f7b0253a5..3b436cced 100644
--- a/src/base/remote_gdb.cc
+++ b/src/base/remote_gdb.cc
@@ -250,6 +250,16 @@ GDBListener::accept()
}
}
+int
+GDBListener::getPort() const
+{
+ panic_if(!listener.islistening(),
+ "Remote GDB port is unknown until GDBListener::listen() has "
+ "been called.\n");
+
+ return port;
+}
+
BaseRemoteGDB::InputEvent::InputEvent(BaseRemoteGDB *g, int fd, int e)
: PollEvent(fd, e), gdb(g)
{}