From 03c3051af409283414a7d14e7a7f596da7aa54de Mon Sep 17 00:00:00 2001 From: Paul Koning Date: Fri, 28 Oct 2011 14:48:38 +0000 Subject: [PATCH] * python/lib/gdb/types.py (deep_items): Rename from deepitems. * NEWS: Mention deep_items. --- gdb/ChangeLog | 5 +++++ gdb/NEWS | 6 ++++++ gdb/python/lib/gdb/types.py | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9f44d03ca40..af51f560398 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-10-28 Paul Koning + + * python/lib/gdb/types.py (deep_items): Rename from deepitems. + * NEWS: Mention deep_items. + 2011-10-28 Alen Skondro * ser-tcp.c [USE_WIN32API] (ETIMEOUT): Don't define if already diff --git a/gdb/NEWS b/gdb/NEWS index 5cdb63e58e2..973ed0b06a1 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -56,6 +56,12 @@ ** A new event "gdb.new_objfile" has been added, triggered by loading a new object file. + ** A new function, "deep_items" has been added to the gdb.types + module in the GDB Python modules library. This function returns + an iterator over the fields of a struct or union type. Unlike + the standard Python "iteritems" method, it will recursively traverse + any anonymous fields. + * libthread-db-search-path now supports two special values: $sdir and $pdir. $sdir specifies the default system locations of shared libraries. $pdir specifies the directory where the libpthread used by the application diff --git a/gdb/python/lib/gdb/types.py b/gdb/python/lib/gdb/types.py index 9a9b24557d6..c0aa422eb59 100644 --- a/gdb/python/lib/gdb/types.py +++ b/gdb/python/lib/gdb/types.py @@ -91,7 +91,7 @@ def make_enum_dict(enum_type): return enum_dict -def deepitems (type_): +def deep_items (type_): """Return an iterator that recursively traverses anonymous fields. Arguments: @@ -107,5 +107,5 @@ def deepitems (type_): if k: yield k, v else: - for i in deepitems (v.type): + for i in deep_items (v.type): yield i -- 2.30.2