From 1bd73a4b39fcbe31362c57a6d2e0392018a62435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thilo=20V=C3=B6rtler?= Date: Wed, 1 Jun 2016 15:16:57 +0200 Subject: [PATCH] FIX pretty-printers which call the inferiors though the mi-interface - as described in Bug 17437 the mi interface corrupts cached frames in the list_arg_or_local function of mi-cmd-stack.c when a pretty-printer calls a function of the inferior. To prevent this the frame_id is stored and used to restore the frame after calling list_arg_or_local - MI regressions were run and no effect through the patch was seen --- gdb/mi/mi-cmd-stack.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 390fc7e..5622834 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -581,8 +581,10 @@ list_args_or_locals (enum what_to_list what, enum print_values values, struct type *type; char *name_of_result; struct ui_out *uiout = current_uiout; + struct frame_id id; block = get_frame_block (fi, 0); + id = get_frame_id (fi); switch (what) { @@ -680,6 +682,8 @@ list_args_or_locals (enum what_to_list what, enum print_values values, list_arg_or_local (&entryarg, what, values, skip_unavailable); xfree (arg.error); xfree (entryarg.error); + + fi = frame_find_by_id(id); } } -- 1.7.1