From 0dffd35741fafc4d51102c7276b61306bfa73d87 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Wed, 4 May 2011 10:08:08 -0400 Subject: debug: fix help output --- src/python/m5/debug.py | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/python/m5/debug.py') diff --git a/src/python/m5/debug.py b/src/python/m5/debug.py index 8231126a0..508bf2842 100644 --- a/src/python/m5/debug.py +++ b/src/python/m5/debug.py @@ -26,24 +26,36 @@ # # Authors: Nathan Binkert +from UserDict import DictMixin + import internal +from internal.debug import SimpleFlag, CompoundFlag from internal.debug import schedBreakCycle, setRemoteGDBPort +from m5.util import printList def help(): print "Base Flags:" - for flag in flags.basic: - print " %s: %s" % (flag, flags.descriptions[flag]) + for name in sorted(flags): + if name == 'All': + continue + flag = flags[name] + children = [c for c in flag.kids() ] + if not children: + print " %s: %s" % (name, flag.desc()) print print "Compound Flags:" - for flag in flags.compound: - if flag == 'All': + for name in sorted(flags): + if name == 'All': continue - print " %s: %s" % (flag, flags.descriptions[flag]) - util.printList(flags.compoundMap[flag], indent=8) - print + flag = flags[name] + children = [c for c in flag.kids() ] + if children: + print " %s: %s" % (name, flag.desc()) + printList([ c.name() for c in children ], indent=8) + print -class AllFlags(object): +class AllFlags(DictMixin): def __init__(self): self._version = -1 self._dict = {} -- cgit v1.2.3