Skip to content

Commit

Permalink
[gdb] Don't throw an exception for types that have no fields
Browse files Browse the repository at this point in the history
The JsDbg frontend will call GetAllFields even for types such as
'char'. For such types, accessing .fields() will throw an exception,
which makes the Objdiff extension fail. Instead, just return [].
  • Loading branch information
cbiesinger committed Aug 20, 2019
1 parent 8bd22f2 commit 4acbfa8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion server/JsDbg.Gdb/JsDbg.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,15 @@ def GetAllFields(module, type, includeBaseTypes):
if t is None:
return None

fields = t.fields()
resultFields = []

try:
fields = t.fields()
except:
# If this is a type that has no fields, return instead of throwing
# an exception (e.g. 'char').
return resultFields

for field in fields:
if field.is_base_class:
if not includeBaseTypes:
Expand Down

0 comments on commit 4acbfa8

Please sign in to comment.