gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: sim: Remove unused SimObject::debugObjectBreak

GT
Giacomo Travaglini (Gerrit)
Mon, Mar 20, 2023 2:42 PM

Giacomo Travaglini has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/69078?usp=email )

Change subject: sim: Remove unused SimObject::debugObjectBreak
......................................................................

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 giacomo.travaglini@arm.com

M src/sim/sim_object.cc
M src/sim/sim_object.hh
2 files changed, 0 insertions(+), 36 deletions(-)

diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc
index d10be92..e91d3e2 100644
--- a/src/sim/sim_object.cc
+++ b/src/sim/sim_object.cc
@@ -60,9 +60,6 @@
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 @@
    }
    }

-#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 c2c5d4d..047821d 100644
    --- a/src/sim/sim_object.hh
    +++ b/src/sim/sim_object.hh
    @@ -329,12 +329,6 @@
    */
    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 @@
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

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69078?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ic21e8f55b5e35480c2bc617c24e1352c37516e8f
Gerrit-Change-Number: 69078
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini giacomo.travaglini@arm.com
Gerrit-MessageType: newchange

Giacomo Travaglini has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69078?usp=email ) Change subject: sim: Remove unused SimObject::debugObjectBreak ...................................................................... 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 <giacomo.travaglini@arm.com> --- M src/sim/sim_object.cc M src/sim/sim_object.hh 2 files changed, 0 insertions(+), 36 deletions(-) diff --git a/src/sim/sim_object.cc b/src/sim/sim_object.cc index d10be92..e91d3e2 100644 --- a/src/sim/sim_object.cc +++ b/src/sim/sim_object.cc @@ -60,9 +60,6 @@ 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 @@ } } -#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 c2c5d4d..047821d 100644 --- a/src/sim/sim_object.hh +++ b/src/sim/sim_object.hh @@ -329,12 +329,6 @@ */ 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 @@ 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 -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69078?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ic21e8f55b5e35480c2bc617c24e1352c37516e8f Gerrit-Change-Number: 69078 Gerrit-PatchSet: 1 Gerrit-Owner: Giacomo Travaglini <giacomo.travaglini@arm.com> Gerrit-MessageType: newchange