]> git.saurik.com Git - wxWidgets.git/commitdiff
Recognize wxDefaultDateTime in gdb wxDateTime pretty-printer.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 28 Apr 2012 22:24:57 +0000 (22:24 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 28 Apr 2012 22:24:57 +0000 (22:24 +0000)
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

index 26186867aafcd19e59c60436a9601fec29fa3599..00670d8549773b4868477ee33ca670693503a587 100755 (executable)
@@ -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(' ')