Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* varobj bug?
@ 2009-06-07 23:40 Pedro Alves
  2009-06-09 21:11 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2009-06-07 23:40 UTC (permalink / raw)
  To: gdb-patches

[ Just stumbled on this while reading this code. ]

Isn't the patch below a bug fix?  FI possibly points at
the frame returned by:

 fi = find_frame_addr_in_frame_chain (frame);

not the originally selected frame.

Maybe this code should be using make_cleanup_restore_current_thread?

-- 
Pedro Alves

---
 gdb/varobj.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: src/gdb/varobj.c
===================================================================
--- src.orig/gdb/varobj.c	2009-06-08 00:37:55.000000000 +0100
+++ src/gdb/varobj.c	2009-06-08 00:38:47.000000000 +0100
@@ -577,7 +577,7 @@ varobj_create (char *objname,
       var->root->rootvar = var;
 
       /* Reset the selected frame */
-      if (fi != NULL)
+      if (old_fi != NULL)
 	select_frame (old_fi);
     }
 


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

* Re: varobj bug?
  2009-06-07 23:40 varobj bug? Pedro Alves
@ 2009-06-09 21:11 ` Tom Tromey
  2009-06-10 23:41   ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2009-06-09 21:11 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

>>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Pedro> [ Just stumbled on this while reading this code. ]
Pedro> Isn't the patch below a bug fix?  FI possibly points at
Pedro> the frame returned by:
Pedro>  fi = find_frame_addr_in_frame_chain (frame);
Pedro> not the originally selected frame.

I agree with your analysis.

Pedro> Maybe this code should be using make_cleanup_restore_current_thread?

This also sounds reasonable.

Tom


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

* Re: varobj bug?
  2009-06-09 21:11 ` Tom Tromey
@ 2009-06-10 23:41   ` Pedro Alves
  0 siblings, 0 replies; 3+ messages in thread
From: Pedro Alves @ 2009-06-10 23:41 UTC (permalink / raw)
  To: tromey; +Cc: gdb-patches

On Tuesday 09 June 2009 22:09:14, Tom Tromey wrote:
> >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> 
> Pedro> [ Just stumbled on this while reading this code. ]
> Pedro> Isn't the patch below a bug fix?  FI possibly points at
> Pedro> the frame returned by:
> Pedro>  fi = find_frame_addr_in_frame_chain (frame);
> Pedro> not the originally selected frame.
> 
> I agree with your analysis.

Thanks.  I tested and checked in the fixlet with this
changelog entry:

2009-06-11  Pedro Alves  <pedro@codesourcery.com>

	* varobj.c (varobj_create): Properly restore the selected frame.

> Pedro> Maybe this code should be using make_cleanup_restore_current_thread?
> 
> This also sounds reasonable.

Ok, I'll see about cooking something up.

-- 
Pedro Alves


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

end of thread, other threads:[~2009-06-10 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-07 23:40 varobj bug? Pedro Alves
2009-06-09 21:11 ` Tom Tromey
2009-06-10 23:41   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox