Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Vörtler, Thilo" <thilo.voertler@coseda-tech.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PING] RE: [RFC][PATCH] - Fix pretty-printers which call the inferiors,  mi-interface crashs
Date: Fri, 15 Jul 2016 09:04:00 -0000	[thread overview]
Message-ID: <641e01aae8f7432e98eb2aba3f54f022@EX132MBOX2B.de2.local> (raw)

[-- Attachment #1: Type: text/plain, Size: 2329 bytes --]

Ping !

> Hi,
> 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
> 
> Is this patch okay?
> 
> BR, Thilo
> 
> 
> gdb/ChangeLog:
> 
> 2016-06-02  Thilo Vörtler  <thilo.voertler@coseda-tech.com>
> 
> 	* mi-cmd-stack.c (list_args_or_locals) 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
>
From 1bd73a4b39fcbe31362c57a6d2e0392018a62435 Mon Sep 17 00:00:00 2001
>From: =?UTF-8?q?Thilo=20V=C3=B6rtler?= <thilo.voertler@coseda-tech.com>
>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

[-- Attachment #2: 0001-FIX-pretty-printers-which-call-the-inferiors-though-.patch --]
[-- Type: application/octet-stream, Size: 1418 bytes --]

From 1bd73a4b39fcbe31362c57a6d2e0392018a62435 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thilo=20V=C3=B6rtler?= <thilo.voertler@coseda-tech.com>
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


             reply	other threads:[~2016-07-15  9:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-15  9:04 Vörtler, Thilo [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-06-27 14:36 Vörtler, Thilo
2016-10-04 17:41 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=641e01aae8f7432e98eb2aba3f54f022@EX132MBOX2B.de2.local \
    --to=thilo.voertler@coseda-tech.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox