- match according to type
authorSree Harsha Totakura <totakura@in.tum.de>
Tue, 17 Sep 2013 14:51:41 +0000 (14:51 +0000)
committerSree Harsha Totakura <totakura@in.tum.de>
Tue, 17 Sep 2013 14:51:41 +0000 (14:51 +0000)
contrib/gdb-iterate-dll.py

index 23b4b5fc7d92bd71eeda2d03f7b689cb207f8625..728747363306fdc97738f943a030114bd8ab8302 100644 (file)
@@ -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: