From 3388e88ae4f66bfb76b90807d38ae5ffa61b3245 Mon Sep 17 00:00:00 2001 From: hjk <qtc-committer@nokia.com> Date: Thu, 4 Nov 2010 10:50:13 +0100 Subject: [PATCH] debugger: catch python exception Iterating through gdb.Frame.blocks() also yields function-local struct definitions that cause later errors when attempting to use them as local variable. This is arguably a gdb issue as it is inconsistent with the result of plain old "info locals" output. Reviewed-by: Friedemann Kleint --- share/qtcreator/gdbmacros/dumper.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/share/qtcreator/gdbmacros/dumper.py b/share/qtcreator/gdbmacros/dumper.py index bbaf1d423e1..d6d5e519d8d 100644 --- a/share/qtcreator/gdbmacros/dumper.py +++ b/share/qtcreator/gdbmacros/dumper.py @@ -491,9 +491,12 @@ def listOfLocals(varList): item = Item(0, "local", name, name) try: item.value = frame.read_var(name) # this is a gdb value - except RuntimeError: - # happens for void foo() { std::string s; std::wstring w; } - #warn(" FRAME READ VAR ERROR: %s (%s): " % (symbol, name)) + except: + # RuntimeError: happens for + # void foo() { std::string s; std::wstring w; } + # ValueError: happens for (as of 2010/11/4) + # a local struct as found e.g. in + # gcc sources in gcc.c, int execute() continue #warn("ITEM %s: " % item.value) items.append(item) -- GitLab