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
This commit is contained in:
parent
586c455167
commit
d4bc7a1601
1 changed files with 2 additions and 0 deletions
|
|
@ -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(' ')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue