mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:44:58 +00:00
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.
This commit is contained in:
parent
3d0786f96b
commit
b808815e57
1 changed files with 7 additions and 0 deletions
|
@ -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)}>'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue