Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: gdb-patches@sources.redhat.com
Subject: Re: MI: Another -var-update bug? [PATCH]
Date: Wed, 13 Dec 2006 06:32:00 -0000	[thread overview]
Message-ID: <17791.40309.90872.126841@kahikatea.snap.net.nz> (raw)
In-Reply-To: <17790.36044.454650.114329@kahikatea.snap.net.nz>

 > Variable objects appear to test scope on a frame basis (in c_value_of root).
 > If we create a variable object for j in the inner block of the program below
 > then doing -var-update on line 10 doesn't report it as being out of scope.
 > But struct varobj_root has a member struct block *valid_block.  Presumably
 > the addresses in this structure can be used to test if the variable is still
 > in scope or not

Something like below?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


2006-12-13  Nick Roberts  <nickrob@snap.net.nz>

	* varobj.c: Include block.h.
	(c_value_of_root): Check scope within nested statements.


*** varobj.c	09 Dec 2006 10:59:12 +1300	1.65
--- varobj.c	13 Dec 2006 19:17:36 +1300	
***************
*** 26,31 ****
--- 26,32 ----
  #include "language.h"
  #include "wrapper.h"
  #include "gdbcmd.h"
+ #include "block.h"
  
  #include "gdb_assert.h"
  #include "gdb_string.h"
*************** c_value_of_root (struct varobj **var_han
*** 1958,1965 ****
        fi = frame_find_by_id (var->root->frame);
        within_scope = fi != NULL;
        /* FIXME: select_frame could fail */
!       if (within_scope)
! 	select_frame (fi);
      }
  
    if (within_scope)
--- 1959,1972 ----
        fi = frame_find_by_id (var->root->frame);
        within_scope = fi != NULL;
        /* FIXME: select_frame could fail */
!       if (fi)
! 	{
! 	  CORE_ADDR pc = get_frame_pc (fi);
! 	  if (pc <  BLOCK_START (var->root->valid_block) ||
! 	      pc >= BLOCK_END (var->root->valid_block))
! 	    within_scope = 0;
! 	  select_frame (fi);
! 	}	  
      }
  
    if (within_scope)


  reply	other threads:[~2006-12-13  6:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 11:09 MI: Another -var-update bug? Nick Roberts
2006-12-13  6:32 ` Nick Roberts [this message]
2006-12-30 15:06   ` MI: Another -var-update bug? [PATCH] Daniel Jacobowitz
2006-12-30 22:43     ` Nick Roberts
2006-12-31  2:19       ` Daniel Jacobowitz
2007-01-01 16:24         ` Daniel Jacobowitz
2007-01-01 22:13           ` Nick Roberts
2007-01-04 18:51             ` Vladimir Prus
2007-01-04 19:43               ` Nick Roberts
2007-01-04 18:49   ` Vladimir Prus
2007-01-04 23:59     ` Nick Roberts
2007-01-05  9:10       ` Vladimir Prus
2007-01-05 15:10         ` Daniel Jacobowitz

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=17791.40309.90872.126841@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sources.redhat.com \
    /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