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:
Jan de Mooij 2019-08-08 11:57:21 +00:00
Родитель a29edd5706
Коммит c2329d1abb
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -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