summaryrefslogtreecommitdiff
path: root/Meta
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-05-22 12:12:51 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-22 13:21:00 +0430
commitb808815e57fe680ec2d98ac2dc5bccd610e871ca (patch)
tree1168493e9b487a8c92f943d37c0b658081ba7f13 /Meta
parent3d0786f96b9157b959409f43a8eb5312ec847e04 (diff)
downloadserenity-b808815e57fe680ec2d98ac2dc5bccd610e871ca.zip
Meta: Display DistinctNumeric as its alias name in GDB if possible
All DistinctNumerics are given an identifying tag, if the tag is generated by the macro, print the alias instead of DistinctNumeric.
Diffstat (limited to 'Meta')
-rw-r--r--Meta/serenity_gdb.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Meta/serenity_gdb.py b/Meta/serenity_gdb.py
index 5cd6aef5db..de7c6d0621 100644
--- a/Meta/serenity_gdb.py
+++ b/Meta/serenity_gdb.py
@@ -78,6 +78,13 @@ class AKDistinctNumeric:
@classmethod
def prettyprint_type(cls, type):
+ actual_name = type.template_argument(1)
+ parts = actual_name.name.split("::")
+ unqualified_name = re.sub(r'__(\w+)_tag', r'\1', actual_name.name)
+ if unqualified_name != actual_name.name:
+ qualified_name = '::'.join(parts[:-2] + [unqualified_name])
+ return qualified_name
+ # If the tag is malformed, just print DistinctNumeric<T>
contained_type = type.template_argument(0)
return f'AK::DistinctNumeric<{handler_class_for_type(contained_type).prettyprint_type(contained_type)}>'