From e4a98644587f7d547a7acfa4998a54a4945b5f8f Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 20 Mar 2023 13:10:48 +0000 Subject: [PATCH] sim: Remove unused SimObject::debugObjectBreak The static method is only present in gem5.debug builds and it doesn't seem to do anything else than setting up a boolean flag. I was not able to understand from git history which was the purpose of it but I am confident it's not currently used. It was maybe meant to work with the --debug-break option, which sends a SIGRAP to the current PID in order to halt a GDB session at a specific time. Maybe the idea was to halt only when executing a SimObject method? Change-Id: Ic21e8f55b5e35480c2bc617c24e1352c37516e8f Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69078 Reviewed-by: Daniel Carvalho Tested-by: kokoro Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power --- src/sim/sim_object.cc | 27 --------------------------- src/sim/sim_object.hh | 9 --------- 2 files changed, 36 deletions(-) diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc index d10be92b44..e91d3e2407 100644 --- a/src/sim/sim_object.cc +++ b/src/sim/sim_object.cc @@ -60,9 +60,6 @@ SimObject::SimObject(const Params &p) statistics::Group(nullptr), Named(p.name), _params(p) { -#ifdef DEBUG - doDebugBreak = false; -#endif simObjectList.push_back(this); probeManager = new ProbeManager(this); } @@ -148,30 +145,6 @@ SimObject::serializeAll(const std::string &cpt_dir) } } -#ifdef DEBUG -// -// static function: flag which objects should have the debugger break -// -void -SimObject::debugObjectBreak(const std::string &objs) -{ - SimObjectList::const_iterator i = simObjectList.begin(); - SimObjectList::const_iterator end = simObjectList.end(); - - ObjectMatch match(objs); - for (; i != end; ++i) { - SimObject *obj = *i; - obj->doDebugBreak = match.match(obj->name()); - } -} - -void -debugObjectBreak(const char *objs) -{ - SimObject::debugObjectBreak(std::string(objs)); -} -#endif - SimObject * SimObject::find(const char *name) { diff --git a/src/sim/sim_object.hh b/src/sim/sim_object.hh index c2c5d4d29b..047821d371 100644 --- a/src/sim/sim_object.hh +++ b/src/sim/sim_object.hh @@ -329,12 +329,6 @@ class SimObject : public EventManager, public Serializable, public Drainable, */ static void serializeAll(const std::string &cpt_dir); -#ifdef DEBUG - public: - bool doDebugBreak; - static void debugObjectBreak(const std::string &objs); -#endif - /** * Find the SimObject with the given name and return a pointer to * it. Primarily used for interactive debugging. Argument is @@ -395,9 +389,6 @@ class SimObjectResolver virtual SimObject *resolveSimObject(const std::string &name) = 0; }; -#ifdef DEBUG -void debugObjectBreak(const char *objs); -#endif /** * To avoid circular dependencies the unserialization of SimObjects must be