base: Change prototype of BaseRemoteGDB::trap()

Change the return type of BaseRemoteGDB::trap() to void since the
return value was never used by any of the callers. Also change the
name of second parameter to signum since its value is reported back
to GDB in "S" packet.

Change-Id: I81acfac24ffe62e4ffae6b74bf33f1f07ada3ca7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48180
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Jan Vrany
2021-07-13 23:49:25 +01:00
parent 46a8bc2f56
commit a5789cc8e1
2 changed files with 9 additions and 11 deletions

View File

@@ -10,7 +10,7 @@
* unmodified and in its entirety in all distributions of the software,
* modified or unmodified, in source code or in binary form.
*
* Copyright 2015 LabWare
* Copyright 2015, 2021 LabWare
* Copyright 2014 Google, Inc.
* Copyright (c) 2002-2005 The Regents of The University of Michigan
* All rights reserved.
@@ -483,15 +483,15 @@ BaseRemoteGDB::selectThreadContext(ContextID id)
// present, but might eventually become meaningful. (XXX) It might
// makes sense to use POSIX errno values, because that is what the
// gdb/remote.c functions want to return.
bool
BaseRemoteGDB::trap(ContextID id, int type)
void
BaseRemoteGDB::trap(ContextID id, int signum)
{
if (!attached)
return false;
return;
if (tc->contextId() != id) {
if (!selectThreadContext(id))
return false;
return;
}
DPRINTF(GDBMisc, "trap: PC=%s\n", tc->pcState());
@@ -516,7 +516,7 @@ BaseRemoteGDB::trap(ContextID id, int type)
send("OK");
} else {
// Tell remote host that an exception has occurred.
send("S%02x", type);
send("S%02x", signum);
}
// Stick frame regs into our reg cache.
@@ -524,7 +524,7 @@ BaseRemoteGDB::trap(ContextID id, int type)
regCachePtr->getRegs(tc);
GdbCommand::Context cmd_ctx;
cmd_ctx.type = type;
cmd_ctx.type = signum;
std::vector<char> data;
for (;;) {
@@ -561,8 +561,6 @@ BaseRemoteGDB::trap(ContextID id, int type)
panic("Unrecognzied GDB exception.");
}
}
return true;
}
void

View File

@@ -10,7 +10,7 @@
* unmodified and in its entirety in all distributions of the software,
* modified or unmodified, in source code or in binary form.
*
* Copyright 2015 LabWare
* Copyright 2015, 2021 LabWare
* Copyright 2014 Google, Inc.
* Copyright (c) 2002-2005 The Regents of The University of Michigan
* All rights reserved.
@@ -171,7 +171,7 @@ class BaseRemoteGDB
void replaceThreadContext(ThreadContext *_tc);
bool selectThreadContext(ContextID id);
bool trap(ContextID id, int type);
void trap(ContextID id, int signum);
/** @} */ // end of api_remote_gdb