From 6ab60d4920bb3199aee8cd872b930e9e3e808ba7 Mon Sep 17 00:00:00 2001 From: Nils Gillmann Date: Sat, 19 May 2018 14:43:13 +0000 Subject: Restructure contrib folder. contrib/pogen.sh -> bin/pogen.sh bootstrap: Use new pogen location and execute it. contrib/openvpn-tap32: Move to contrib/3rdparty/Windows/openvpn-tap32. contrib/gnunet-logo*: Move to contrib/branding/logo/ Delete old patches in contrib, predating git. Move buildbot data to contrib/ci/buildbot, move docker data to contrib/ci/docker. Create contrib/conf and populate it with config files found in contrib and bin. Move gns related data to contrib/gns. delete contrib/repeat.sh Move contrib/log.php into contrib/web/log.php. Create folder contrib/scripts and use it for most scripts in contrib. Remove trailing whitespace in doc/Makefile.am Signed-off-by: Nils Gillmann --- contrib/scripts/gdb-iterate-dll.py | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 contrib/scripts/gdb-iterate-dll.py (limited to 'contrib/scripts/gdb-iterate-dll.py') diff --git a/contrib/scripts/gdb-iterate-dll.py b/contrib/scripts/gdb-iterate-dll.py new file mode 100644 index 000000000..79d46aa96 --- /dev/null +++ b/contrib/scripts/gdb-iterate-dll.py @@ -0,0 +1,40 @@ +from gdb import * + + +def search_dll(head, field, match, pfield): + """ + Search in a DLL by iterates over it. + + head: name of the symbol denoting the head of the DLL + field: the field that should be search for match + match: the mathing value for field + pfield: the field whose value is to be printed for matched elements; None to + print all fields of the matched elemented + """ + + (symbol, _) = lookup_symbol(head) + if symbol is None: + print("Can't find symbol: " + head) + return + symbol_val = symbol.value() + while symbol_val: + symbol_val_def = symbol_val.dereference() + field_val = symbol_val_def[field] + if field_val.type.code == gdb.TYPE_CODE_INT: + 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) + res = (match == val) + elif (field_val.type.code == gdb.TYPE_CODE_TYPEDEF): + val = str(field_val) + res = match in val + else: + continue + + if res: + if pfield is None: + print(symbol_val_def) + else: + print(symbol_val_def[pfield]) + symbol_val = symbol_val_def["next"] -- cgit v1.2.3