[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e

evan at chromium.org evan at chromium.org
Fri Jan 21 15:03:29 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit fcec1d8cb1fa2a84f79f5111794e52b2e5341fa1
Author: evan at chromium.org <evan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jan 6 20:34:01 2011 +0000

    2011-01-06  Evan Martin  <evan at chromium.org>
    
            Reviewed by Tony Chang.
    
            [gdb] handle inaccessible memory and UChar*
            https://bugs.webkit.org/show_bug.cgi?id=52003
    
            To pretty-print a UChar*, we just grope around in the memory
            looking for a terminating NUL.  We need to handle the exception
            that can occur when we poke into an invalid location.
    
            Additionally, the logic for choosing which pretty-printer would
            early return before hitting the point where we'd use the UChar*
            printer.  (Did this ever work?  How did it regress?)
    
            * gdb/webkit.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 7c607d7..bced143 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-06  Evan Martin  <evan at chromium.org>
+
+        Reviewed by Tony Chang.
+
+        [gdb] handle inaccessible memory and UChar*
+        https://bugs.webkit.org/show_bug.cgi?id=52003
+
+        To pretty-print a UChar*, we just grope around in the memory
+        looking for a terminating NUL.  We need to handle the exception
+        that can occur when we poke into an invalid location.
+
+        Additionally, the logic for choosing which pretty-printer would
+        early return before hitting the point where we'd use the UChar*
+        printer.  (Did this ever work?  How did it regress?)
+
+        * gdb/webkit.py:
+
 2011-01-05  Brian Weinstein  <bweinstein at apple.com>
 
         Reviewed by Ada Chan.
diff --git a/Tools/gdb/webkit.py b/Tools/gdb/webkit.py
index 95c3d9c..3f25cc4 100644
--- a/Tools/gdb/webkit.py
+++ b/Tools/gdb/webkit.py
@@ -49,12 +49,18 @@ def ustring_to_string(ptr, length=None):
     if length is None:
         # Try to guess at the length.
         for i in xrange(0, 2048):
-            if int((ptr + i).dereference()) == 0:
+            try:
+                if int((ptr + i).dereference()) == 0:
+                    length = i
+                    break
+            except RuntimeError:
+                # We indexed into inaccessible memory; give up.
                 length = i
+                extra = u' (gdb hit inaccessible memory)'
                 break
         if length is None:
             length = 256
-            extra = u' (no trailing NUL found)'
+            extra = u' (gdb found no trailing NUL)'
     else:
         length = int(length)
 
@@ -229,15 +235,15 @@ class WTFVectorPrinter:
         return 'array'
 
 def add_pretty_printers():
-    pretty_printers_dict = {
-        re.compile("^WTF::Vector<.*>$"): WTFVectorPrinter,
-        re.compile("^WTF::AtomicString$"): WTFAtomicStringPrinter,
-        re.compile("^WTF::String$"): WTFStringPrinter,
-        re.compile("^WebCore::QualifiedName$"): WebCoreQualifiedNamePrinter,
-        re.compile("^JSC::UString$"): JSCUStringPrinter,
-        re.compile("^JSC::Identifier$"): JSCIdentifierPrinter,
-        re.compile("^JSC::JSString$"): JSCJSStringPrinter,
-    }
+    pretty_printers = (
+        (re.compile("^WTF::Vector<.*>$"), WTFVectorPrinter),
+        (re.compile("^WTF::AtomicString$"), WTFAtomicStringPrinter),
+        (re.compile("^WTF::String$"), WTFStringPrinter),
+        (re.compile("^WebCore::QualifiedName$"), WebCoreQualifiedNamePrinter),
+        (re.compile("^JSC::UString$"), JSCUStringPrinter),
+        (re.compile("^JSC::Identifier$"), JSCIdentifierPrinter),
+        (re.compile("^JSC::JSString$"), JSCJSStringPrinter),
+    )
 
     def lookup_function(val):
         """Function used to load pretty printers; will be passed to GDB."""
@@ -245,12 +251,11 @@ def add_pretty_printers():
         if type.code == gdb.TYPE_CODE_REF:
             type = type.target()
         type = type.unqualified().strip_typedefs()
-        typename = type.tag
-        if not typename:
-            return None
-        for function, pretty_printer in pretty_printers_dict.items():
-            if function.search(typename):
-                return pretty_printer(val)
+        tag = type.tag
+        if tag:
+            for function, pretty_printer in pretty_printers:
+                if function.search(tag):
+                    return pretty_printer(val)
 
         if type.code == gdb.TYPE_CODE_PTR:
             name = str(type.target().unqualified())

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list