Added -l/--list to dbgtag.py

Inspired by errno's/dbgerr.py's -l/--list, this gives a quick and easy
list of the current tag encodings, which can be very useful:

  $ ./scripts/dbgtag.py -l
  LFSR_TAG_NULL       0x0000  v--- ---- ---- ----
  LFSR_TAG_CONFIG     0x00tt  v--- ---- -ttt tttt
  LFSR_TAG_MAGIC      0x0003  v--- ---- ---- --11
  LFSR_TAG_VERSION    0x0004  v--- ---- ---- -1--
  ... snip ...

We already need to keep dbgtag.py in-sync or risk a bad debugging
experience, so we might as well let it tell us all the information it
currently knows.

Also yay for self-inspecting code, I don't know if it's bad that I'm
becoming a fan of parsing information out of comments...
This commit is contained in:
Christopher Haster
2024-06-10 13:44:49 -05:00
parent 3dc597cb5f
commit ae0e3348fe
7 changed files with 322 additions and 284 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ def main(errs, *,
# print
for n, e, h in ERRS:
print('%-*s %-*s %s' % (
print('%-*s %-*s %s' % (
w[0], 'LFS_ERR_'+n,
w[1], e,
h))