commit 6a636f747d1e11cb3bc331f4bc5f5484010dd0e8 Author: public Date: Sat Dec 6 09:07:21 2025 +0800 formatters diff --git a/formatters/chrono.py b/formatters/chrono.py new file mode 100644 index 0000000..506ee89 --- /dev/null +++ b/formatters/chrono.py @@ -0,0 +1,14 @@ +from datetime import datetime,timedelta + +print('loading lldb chrono formatter') + +def GetSummary(valobj, internal_dict): + yof = valobj.GetChildMemberWithName('datetime').GetChildMemberWithName('date').GetChildMemberWithName('yof').GetChildMemberWithName('__0').GetChildMemberWithName('__0').GetValue(); + if (yof == None): + yof = valobj.GetChildMemberWithName('datetime').GetChildMemberWithName('date').GetChildMemberWithName('yof').GetChildMemberWithName('__0').GetChildMemberWithName('0').GetValue(); + secs = valobj.GetChildMemberWithName('datetime').GetChildMemberWithName('time').GetChildMemberWithName('secs').GetValue(); + year = int(yof) >> 13 + day_of_year = (int(yof) & 8191) >> 4; + date = datetime(year -1, 12, 31) + timedelta(days=day_of_year) + timedelta(seconds=int(secs)) + return date.strftime('%Y-%m-%d %H:%M:%S') +