]> git.saurik.com Git - wxWidgets.git/commitdiff
Update gdb pretty printing support for latest gdb version.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 11 Nov 2009 23:08:41 +0000 (23:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 11 Nov 2009 23:08:41 +0000 (23:08 +0000)
gdb.pretty_printers is not a map any more but a list containing lookup
functions for pretty printers.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

misc/gdb/print.py

index 46a71d0056f313de4e997131939a89535880b86a..9df3beb66c6135097e04198e8fd0c24364b16dcc 100755 (executable)
@@ -18,4 +18,12 @@ class wxStringPrinter:
     def to_string(self):
         return '"' + self.val['m_impl']['_M_dataplus']['_M_p'].string() + '"'
 
-gdb.pretty_printers['^wxString$'] = wxStringPrinter
+    def display_hint(self):
+        return 'string'
+
+def wxLookupFunction(val):
+    if val.type.tag == 'wxString':
+        return wxStringPrinter(val)
+    return None
+
+gdb.pretty_printers.append(wxLookupFunction)