summaryrefslogtreecommitdiff
path: root/src/sim/system.cc
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2012-08-06 16:52:49 -0700
committerSteve Reinhardt <steve.reinhardt@amd.com>2012-08-06 16:52:49 -0700
commitb647b48bf4d980e26b4626e94f1207ad66fc324e (patch)
tree552ff31c06305500cde480a456a152d94f9e1293 /src/sim/system.cc
parentd55115936e0711422c6d708572b391e15432bec1 (diff)
downloadgem5-b647b48bf4d980e26b4626e94f1207ad66fc324e.tar.xz
str: add an overloaded startswith() utility method
for various string types and use it in a few places.
Diffstat (limited to 'src/sim/system.cc')
-rw-r--r--src/sim/system.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sim/system.cc b/src/sim/system.cc
index 67fb7480a..20fcbd948 100644
--- a/src/sim/system.cc
+++ b/src/sim/system.cc
@@ -51,6 +51,7 @@
#include "arch/vtophys.hh"
#include "base/loader/object_file.hh"
#include "base/loader/symtab.hh"
+#include "base/str.hh"
#include "base/trace.hh"
#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
@@ -402,8 +403,7 @@ MasterID
System::getMasterId(std::string master_name)
{
// strip off system name if the string starts with it
- if (master_name.size() > name().size() &&
- master_name.compare(0, name().size(), name()) == 0)
+ if (startswith(master_name, name()))
master_name = master_name.erase(0, name().size() + 1);
// CPUs in switch_cpus ask for ids again after switching