From d4bc7a1601b650e9e6e11263e7aa87b83fa10c25 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 28 Apr 2012 22:24:57 +0000 Subject: [PATCH] Recognize wxDefaultDateTime in gdb wxDateTime pretty-printer. Trying to print an uninitialized/invalid wxDateTime in gdb resulted in an error (Python exception from datetime module), recognize it specially now. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71305 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- misc/gdb/print.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/misc/gdb/print.py b/misc/gdb/print.py index 26186867aa..00670d8549 100755 --- a/misc/gdb/print.py +++ b/misc/gdb/print.py @@ -36,6 +36,8 @@ class wxDateTimePrinter: # expressions directly so we need to convert it to long long first and # then cast to int explicitly to be able to use it as a timestamp. msec = self.val['m_time'].cast(gdb.lookup_type('long long')) + if msec == 0x8000000000000000: + return 'NONE' sec = int(msec / 1000) return datetime.datetime.fromtimestamp(sec).isoformat(' ') -- 2.47.2