public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PING] RE: [RFC][PATCH] - Fix pretty-printers which call the inferiors,  mi-interface crashs
@ 2016-06-27 14:36 Vörtler, Thilo
  2016-10-04 17:41 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Vörtler, Thilo @ 2016-06-27 14:36 UTC (permalink / raw)
  To: gdb-patches

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

> -----Ursprüngliche Nachricht-----
> Von: Vörtler, Thilo
> Gesendet: Donnerstag, 2. Juni 2016 11:09
> An: 'gdb-patches@sourceware.org' <gdb-patches@sourceware.org>
> Betreff: [RFC][PATCH] - Fix pretty-printers which call the inferiors, mi-
> interface crashs
> 
> 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

[-- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PING] RE: [RFC][PATCH] - Fix pretty-printers which call the inferiors, mi-interface crashs
  2016-06-27 14:36 [PING] RE: [RFC][PATCH] - Fix pretty-printers which call the inferiors, mi-interface crashs Vörtler, Thilo
@ 2016-10-04 17:41 ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2016-10-04 17:41 UTC (permalink / raw)
  To: Vörtler, Thilo, gdb-patches

Hi there,

Sorry for the delay.  Thanks much for digging in and writing
the patch.  It'd be really great if we could have a testcase in
the testsuite to exercise this.  That'd help move the patch along,
and, it'd make sure we don't regress again in the future.

Thanks,
Pedro Alves

On 06/27/2016 03:35 PM, Vörtler, Thilo wrote:
>> -----Ursprüngliche Nachricht-----
>> Von: Vörtler, Thilo
>> Gesendet: Donnerstag, 2. Juni 2016 11:09
>> An: 'gdb-patches@sourceware.org' <gdb-patches@sourceware.org>
>> Betreff: [RFC][PATCH] - Fix pretty-printers which call the inferiors, mi-
>> interface crashs
>>
>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PING] RE: [RFC][PATCH] - Fix pretty-printers which call the inferiors,  mi-interface crashs
@ 2016-07-15  9:04 Vörtler, Thilo
  0 siblings, 0 replies; 3+ messages in thread
From: Vörtler, Thilo @ 2016-07-15  9:04 UTC (permalink / raw)
  To: gdb-patches

[-- 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-10-04 17:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-27 14:36 [PING] RE: [RFC][PATCH] - Fix pretty-printers which call the inferiors, mi-interface crashs Vörtler, Thilo
2016-10-04 17:41 ` Pedro Alves
2016-07-15  9:04 Vörtler, Thilo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).