summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2018-05-03 00:14:42 +0100
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2018-05-09 17:48:23 +0000
commite89e83529ad17bc1ae7ae23d337fd4067db01708 (patch)
treeed08b2d24a34088371851958a48e4aa8b3e28154
parentb7bf68e287da0bda044e9b5e8366169fad86c27a (diff)
downloadgem5-e89e83529ad17bc1ae7ae23d337fd4067db01708.tar.xz
sim: Remove trailing dot when assigning a master's name
This patch fixes the master's name allocation in the system. The error was occurring when a submaster was not specified in getMasterId: a trailing separation dot was still added to the master's name. Change-Id: I0e67900f6fdd36a61900453b55219fc7007d1b05 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/10301 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Jason Lowe-Power <jason@lowepower.com>
-rw-r--r--src/sim/system.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 911ee5d9b..74bc94ee8 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -538,10 +538,13 @@ System::_getMasterId(const SimObject* master, std::string master_name)
std::string
System::leafMasterName(const SimObject* master, const std::string& submaster)
{
- // Get the full master name by appending the submaster name to
- // the root SimObject master name
- auto master_name = master->name() + "." + submaster;
- return master_name;
+ if (submaster.empty()) {
+ return master->name();
+ } else {
+ // Get the full master name by appending the submaster name to
+ // the root SimObject master name
+ return master->name() + "." + submaster;
+ }
}
std::string