⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 102083 in webkit


Ignore:
Timestamp:
Dec 5, 2011, 6:07:23 PM (15 years ago)
Author:
kubo@profusion.mobi
Message:

webkit.py: Really fix the printing of StringImpl now that 8-bit strings are present.
https://bugs.webkit.org/show_bug.cgi?id=73878

Reviewed by Tony Chang.

r98624 turned StringImpl::m_data into StringImpl::{m_data8,m_data16}.
r98785 made webkit.py always use m_data16, which does not work when
the string is an 8-bit string (such as KURL::string()).

I was not able to directly call StringImpl::is8Bit() in the Python
code, so I just reproduced the implementation there.

  • gdb/webkit.py:

(WTFStringPrinter.is_8bit): Reproduced StringImpl::is8Bit().
(WTFStringPrinter.to_string):
(JSCUStringPrinter.is_8bit): Reproduced StringImpl::is8Bit().
(JSCUStringPrinter.to_string):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r102072 r102083  
     12011-12-05  Raphael Kubo da Costa  <kubo@profusion.mobi>
     2
     3        webkit.py: Really fix the printing of StringImpl now that 8-bit strings are present.
     4        https://bugs.webkit.org/show_bug.cgi?id=73878
     5
     6        Reviewed by Tony Chang.
     7
     8        r98624 turned StringImpl::m_data into StringImpl::{m_data8,m_data16}.
     9        r98785 made webkit.py always use m_data16, which does not work when
     10        the string is an 8-bit string (such as KURL::string()).
     11
     12        I was not able to directly call StringImpl::is8Bit() in the Python
     13        code, so I just reproduced the implementation there.
     14
     15        * gdb/webkit.py:
     16        (WTFStringPrinter.is_8bit): Reproduced StringImpl::is8Bit().
     17        (WTFStringPrinter.to_string):
     18        (JSCUStringPrinter.is_8bit): Reproduced StringImpl::is8Bit().
     19        (JSCUStringPrinter.to_string):
     20
    1212011-12-05  Eric Seidel  <eric@webkit.org>
    222
  • trunk/Tools/gdb/webkit.py

    r98785 r102083  
    108108        return self.val['m_impl']['m_ptr']['m_length']
    109109
     110    def is_8bit(self):
     111        return self.val['m_impl']['m_ptr']['m_hashAndFlags'] & self.val['m_impl']['m_ptr']['s_hashFlag8BitBuffer']
     112
    110113    def to_string(self):
    111114        if self.get_length() == 0:
    112115            return '(null)'
    113116
    114         return ustring_to_string(self.val['m_impl']['m_ptr']['m_data16'],
     117        if self.is_8bit():
     118            data_member = 'm_data8'
     119        else:
     120            data_member = 'm_data16'
     121
     122        return ustring_to_string(self.val['m_impl']['m_ptr'][data_member],
    115123                                 self.get_length())
    116124
     
    123131        return self.val['m_impl']['m_ptr']['m_length']
    124132
     133    def is_8bit(self):
     134        return self.val['m_impl']['m_ptr']['m_hashAndFlags'] & self.val['m_impl']['m_ptr']['s_hashFlag8BitBuffer']
     135
    125136    def to_string(self):
    126137        if self.get_length() == 0:
    127138            return ''
    128139
    129         return ustring_to_string(self.val['m_impl']['m_ptr']['m_data16'],
     140        if self.is_8bit():
     141            data_member = 'm_data8'
     142        else:
     143            data_member = 'm_data16'
     144
     145        return ustring_to_string(self.val['m_impl']['m_ptr'][data_member],
    130146                                 self.get_length())
    131147
Note: See TracChangeset for help on using the changeset viewer.