From 729eee2e184550d3d94a8a964f265f5c4ce001cc Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Tue, 17 Sep 2013 14:51:41 +0000 Subject: - match according to type --- contrib/gdb-iterate-dll.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'contrib') diff --git a/contrib/gdb-iterate-dll.py b/contrib/gdb-iterate-dll.py index 23b4b5fc7..728747363 100644 --- a/contrib/gdb-iterate-dll.py +++ b/contrib/gdb-iterate-dll.py @@ -15,9 +15,21 @@ def iterate_dll (head, field, match, pfield): if symbol is None: print "Can't find symbol: " + head return - while not symbol: + while symbol: symbol_val = symbol.value().derefence - if match == symbol_val[field]: + field_val = symbol_val[field] + if field_val.type.code == gdb.TYPE_CODE_INT: + val = int(field_val) + res = (match == val) + if (field_val.type.code == gdb.TYPE_CODE_STRING) + or (filed_val.type.code == gdb.TYPE_CODE_ARRAY): + val = str (field_val) + res = (match == val) + if (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): + val = str (field_val) + res = match in val + + if res: if pfield is None: print symbol_val else: -- cgit v1.2.3