77from detail .decode_ieee_type import decode_decimal128
88from detail .decode_fast_type import decode_decimal_fast32
99from detail .decode_fast_type import decode_decimal_fast64
10+ from detail .decode_fast_type import decode_decimal_fast128
1011
1112import lldb
1213
@@ -73,7 +74,7 @@ def decimal_fast32_summary(valobj, internal_dict):
7374
7475def decimal_fast64_summary (valobj , internal_dict ):
7576 """
76- Custom summary for decimal_fast32_t type
77+ Custom summary for decimal_fast64_t type
7778 Displays in scientific notation
7879 """
7980
@@ -86,6 +87,27 @@ def decimal_fast64_summary(valobj, internal_dict):
8687
8788 except Exception as e :
8889 return f"<invalid decimal_fast64_t: { e } >"
90+ def decimal_fast128_summary (valobj , internal_dict ):
91+ """
92+ Custom summary for decimal_fast128_t type
93+ Displays in scientific notation
94+ """
95+
96+ try :
97+ val = valobj .GetNonSyntheticValue ()
98+
99+ significand = val .GetChildMemberWithName ("significand_" )
100+ bits_high = significand .GetChildMemberWithName ("high" ).GetValueAsUnsigned ()
101+ bits_low = significand .GetChildMemberWithName ("low" ).GetValueAsUnsigned ()
102+ combined_bits = (bits_high << 64 ) | bits_low
103+
104+ exp = val .GetChildMemberWithName ("exponent_" ).GetValueAsUnsigned ()
105+ sign = val .GetChildMemberWithName ("sign_" ).GetValueAsUnsigned ()
106+
107+ return decode_decimal_fast128 (combined_bits , exp , sign )
108+
109+ except Exception as e :
110+ return f"<invalid decimal_fast128_t: { e } >"
89111
90112def __lldb_init_module (debugger , internal_dict ):
91113 decimal32_pattern = r"^(const )?(boost::decimal::decimal32_t|(\w+::)*decimal32_t)( &| \*)?$"
@@ -94,6 +116,7 @@ def __lldb_init_module(debugger, internal_dict):
94116
95117 decimal_fast32_pattern = r"^(const )?(boost::decimal::decimal_fast32_t|(\w+::)*decimal_fast32_t)( &| \*)?$"
96118 decimal_fast64_pattern = r"^(const )?(boost::decimal::decimal_fast64_t|(\w+::)*decimal_fast64_t)( &| \*)?$"
119+ decimal_fast128_pattern = r"^(const )?(boost::decimal::decimal_fast128_t|(\w+::)*decimal_fast128_t)( &| \*)?$"
97120
98121 debugger .HandleCommand (
99122 f'type summary add -x "{ decimal32_pattern } " -e -F decimal_printer.decimal32_summary'
@@ -140,6 +163,15 @@ def __lldb_init_module(debugger, internal_dict):
140163
141164 print ("decimal_fast64_t printer loaded successfully" )
142165
166+ debugger .HandleCommand (
167+ f'type summary add -x "{ decimal_fast128_pattern } " -e -F decimal_printer.decimal_fast128_summary'
168+ )
169+ debugger .HandleCommand (
170+ f'type synthetic add -x "{ decimal_fast128_pattern } " -l decimal_printer.DecimalFastSyntheticProvider'
171+ )
172+
173+ print ("decimal_fast128_t printer loaded successfully" )
174+
143175class DecimalSyntheticProvider :
144176 def __init__ (self , valobj , internal_dict ):
145177 self .valobj = valobj
0 commit comments