from gdb import *
-def search_dll (head, field, match, pfield):
+
+def search_dll(head, field, match, pfield):
"""
Search in a DLL by iterates over it.
print all fields of the matched elemented
"""
- (symbol, _) = lookup_symbol (head)
+ (symbol, _) = lookup_symbol(head)
if symbol is None:
print("Can't find symbol: " + head)
return
val = int(field_val)
res = (match == val)
elif (field_val.type.code == gdb.TYPE_CODE_STRING) or (field_val.type.code == gdb.TYPE_CODE_ARRAY):
- val = str (field_val)
+ val = str(field_val)
res = (match == val)
elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF):
- val = str (field_val)
+ val = str(field_val)
res = match in val
else:
continue
if res:
if pfield is None:
- print symbol_val_def
+ print(symbol_val_def)
else:
print(symbol_val_def[pfield])
symbol_val = symbol_val_def["next"]
-
-