python: Add the ability to check if a debug flag has been enabled
authorAndreas Sandberg <andreas.sandberg@arm.com>
Fri, 4 Sep 2020 16:12:27 +0000 (17:12 +0100)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Mon, 7 Sep 2020 08:42:07 +0000 (08:42 +0000)
commitd2af40faa0a16d17173f71a353f0664a461c263e
tree986da60e35f35a1fee5549c05ef2701843e894a6
parent93ccc23b4ac40b92f4f7c310c17d798e686dcd71
python: Add the ability to check if a debug flag has been enabled

There is currently no Python API to check if a debug flag is
enabled. Add a new status property that can be read or set to control
the status of a flag. The stat of a flag can also be queried by
converting it to a bool.

For example:

  m5.debug.flags["XBar"].status = True

  if m5.debug.flags["XBar"]:
      print("XBar debugging is on")

Change-Id: I5a50c39ced182ab44e18c061c463d7d9c41ef186
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34119
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/python/pybind11/debug.cc