diff options
author | ng0 <ng0@n0.is> | 2018-03-05 08:17:31 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2018-03-05 08:17:31 +0000 |
commit | f18aadc5cbdef52ca02f55f24039f56dbee06321 (patch) | |
tree | fd39a43f8f7f7589ad867c5b5ade6c881ae2cdce /contrib | |
parent | 2046013659e9b495e8561a4cb56bc4e0de0287ac (diff) | |
download | gnunet-f18aadc5cbdef52ca02f55f24039f56dbee06321.tar.gz gnunet-f18aadc5cbdef52ca02f55f24039f56dbee06321.zip |
flake8 gdb-iterate-dll.py
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/gdb-iterate-dll.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/contrib/gdb-iterate-dll.py b/contrib/gdb-iterate-dll.py index d1e3a4af3..79d46aa96 100644 --- a/contrib/gdb-iterate-dll.py +++ b/contrib/gdb-iterate-dll.py | |||
@@ -1,6 +1,7 @@ | |||
1 | from gdb import * | 1 | from gdb import * |
2 | 2 | ||
3 | def search_dll (head, field, match, pfield): | 3 | |
4 | def search_dll(head, field, match, pfield): | ||
4 | """ | 5 | """ |
5 | Search in a DLL by iterates over it. | 6 | Search in a DLL by iterates over it. |
6 | 7 | ||
@@ -11,7 +12,7 @@ def search_dll (head, field, match, pfield): | |||
11 | print all fields of the matched elemented | 12 | print all fields of the matched elemented |
12 | """ | 13 | """ |
13 | 14 | ||
14 | (symbol, _) = lookup_symbol (head) | 15 | (symbol, _) = lookup_symbol(head) |
15 | if symbol is None: | 16 | if symbol is None: |
16 | print("Can't find symbol: " + head) | 17 | print("Can't find symbol: " + head) |
17 | return | 18 | return |
@@ -23,19 +24,17 @@ def search_dll (head, field, match, pfield): | |||
23 | val = int(field_val) | 24 | val = int(field_val) |
24 | res = (match == val) | 25 | res = (match == val) |
25 | elif (field_val.type.code == gdb.TYPE_CODE_STRING) or (field_val.type.code == gdb.TYPE_CODE_ARRAY): | 26 | elif (field_val.type.code == gdb.TYPE_CODE_STRING) or (field_val.type.code == gdb.TYPE_CODE_ARRAY): |
26 | val = str (field_val) | 27 | val = str(field_val) |
27 | res = (match == val) | 28 | res = (match == val) |
28 | elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): | 29 | elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): |
29 | val = str (field_val) | 30 | val = str(field_val) |
30 | res = match in val | 31 | res = match in val |
31 | else: | 32 | else: |
32 | continue | 33 | continue |
33 | 34 | ||
34 | if res: | 35 | if res: |
35 | if pfield is None: | 36 | if pfield is None: |
36 | print symbol_val_def | 37 | print(symbol_val_def) |
37 | else: | 38 | else: |
38 | print(symbol_val_def[pfield]) | 39 | print(symbol_val_def[pfield]) |
39 | symbol_val = symbol_val_def["next"] | 40 | symbol_val = symbol_val_def["next"] |
40 | |||
41 | |||