зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1525664 follow-up - Fix GDB pretty printer for JSString. r=jonco
I had to use try-except instead of "in" because if the value is a pointer type (like JSString*) then "in" returned false. I tested this with both 32-bit and 64-bit builds. Differential Revision: https://phabricator.services.mozilla.com/D40978 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
a29edd5706
Коммит
c2329d1abb
|
@ -43,10 +43,10 @@ class JSStringPtr(Common):
|
|||
|
||||
def chars(self):
|
||||
d = self.value['d']
|
||||
flags = d['flags_']
|
||||
if 'length_' in d.type:
|
||||
length = d['length_']
|
||||
else:
|
||||
flags = self.value['flags_']
|
||||
try:
|
||||
length = self.value['length_']
|
||||
except gdb.error:
|
||||
# If we couldn't fetch the length directly, it must be stored
|
||||
# within `flags`.
|
||||
length = flags >> 32
|
||||
|
|
Загрузка…
Ссылка в новой задаче