WebKit Bugzilla
Attachment 348363 Details for
Bug 189070
: lldb-webkit: KeyError thrown for OptionSet with invalid value
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189070-20180828171731.patch (text/plain), 2.67 KB, created by
Daniel Bates
on 2018-08-28 17:17:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2018-08-28 17:17:32 PDT
Size:
2.67 KB
patch
obsolete
>Subversion Revision: 235381 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 262ba8b7c528d87ffb9e70f9d2eedcdf6ee7de93..d5fd8cde38cfaf7b9d2a551581eb597cb029e369 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,22 @@ >+2018-08-28 Daniel Bates <dabates@apple.com> >+ >+ lldb-webkit: KeyError thrown for uninitialized OptionSet >+ https://bugs.webkit.org/show_bug.cgi?id=189070 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Do not compute what enumerators are in an uninitialized OptionSet. A local OptionSet variable >+ is only considered initialized when execution passes over its assignment regardless of whether >+ the variable is in scope. >+ >+ The LLDB Python API does not provide a way to determine whether an variable is initialized. >+ So, we use a simple heuristic: when the value of the OptionSet is greater than than the value >+ of the largest enumerator then we consider the OptionSet to be garbage (uninitialized memory). >+ When the variable is finally initialized LLDB will notify us to update our state. >+ >+ * lldb/lldb_webkit.py: >+ (WTFOptionSetProvider.update): >+ > 2018-08-28 Daniel Bates <dabates@apple.com> > > lldb-webkit: KeyError thrown for OptionSet >diff --git a/Tools/lldb/lldb_webkit.py b/Tools/lldb/lldb_webkit.py >index 44d77bb5a76b930c5ddc786bc89f57aadf0f0d06..ac6bb32e9de9fe1211200f21ffece2998b01ecf3 100644 >--- a/Tools/lldb/lldb_webkit.py >+++ b/Tools/lldb/lldb_webkit.py >@@ -612,16 +612,22 @@ class WTFOptionSetProvider: > return None > > def update(self): >- self.storage = self.valobj.GetChildMemberWithName('m_storage') >+ self.storage = self.valobj.GetChildMemberWithName('m_storage') # May be uninitialized memory >+ self._elements = [] >+ self.size = 0 > > template_argument_sbType = self.valobj.GetType().GetTemplateArgumentType(0) > enumerator_value_to_name_map = {sbTypeEnumMember.GetValueAsUnsigned(): sbTypeEnumMember.GetName() for sbTypeEnumMember in template_argument_sbType.get_enum_members_array()} > if not enumerator_value_to_name_map: > return > >+ bitmask = self.storage.GetValueAsUnsigned(0) >+ if bitmask > max(enumerator_value_to_name_map): >+ return # self.valobj is uninitialized memory >+ >+ # self.valobj looks like it contains a valid value. > # Iterate from least significant bit to most significant bit. > elements = [] >- bitmask = self.storage.GetValueAsUnsigned(0) > while bitmask > 0: > current = bitmask & -bitmask # Isolate the rightmost set bit. > elements.append((enumerator_value_to_name_map[current], current)) # e.g. ('Spelling', 4)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189070
:
348363
|
348436