diff options
author | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-17 14:51:41 +0000 |
---|---|---|
committer | Sree Harsha Totakura <totakura@in.tum.de> | 2013-09-17 14:51:41 +0000 |
commit | 729eee2e184550d3d94a8a964f265f5c4ce001cc (patch) | |
tree | 10ff202a6a194903d0ab597ca3afa9f6c02bdc65 | |
parent | f605b91f795d125009fd402dc92fdae987e3c012 (diff) | |
download | gnunet-729eee2e184550d3d94a8a964f265f5c4ce001cc.tar.gz gnunet-729eee2e184550d3d94a8a964f265f5c4ce001cc.zip |
- match according to type
-rw-r--r-- | contrib/gdb-iterate-dll.py | 16 |
1 files changed, 14 insertions, 2 deletions
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): | |||
15 | if symbol is None: | 15 | if symbol is None: |
16 | print "Can't find symbol: " + head | 16 | print "Can't find symbol: " + head |
17 | return | 17 | return |
18 | while not symbol: | 18 | while symbol: |
19 | symbol_val = symbol.value().derefence | 19 | symbol_val = symbol.value().derefence |
20 | if match == symbol_val[field]: | 20 | field_val = symbol_val[field] |
21 | if field_val.type.code == gdb.TYPE_CODE_INT: | ||
22 | val = int(field_val) | ||
23 | res = (match == val) | ||
24 | if (field_val.type.code == gdb.TYPE_CODE_STRING) | ||
25 | or (filed_val.type.code == gdb.TYPE_CODE_ARRAY): | ||
26 | val = str (field_val) | ||
27 | res = (match == val) | ||
28 | if (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): | ||
29 | val = str (field_val) | ||
30 | res = match in val | ||
31 | |||
32 | if res: | ||
21 | if pfield is None: | 33 | if pfield is None: |
22 | print symbol_val | 34 | print symbol_val |
23 | else: | 35 | else: |