Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Jim Ingham <jingham@apple.com>
Cc: Vladimir Prus <ghost@cs.msu.su>, gdb-patches@sources.redhat.com
Subject: Re: variable objects and registers
Date: Thu, 21 Dec 2006 23:30:00 -0000	[thread overview]
Message-ID: <17803.6117.15940.138752@kahikatea.snap.net.nz> (raw)
In-Reply-To: <0E190425-7C4F-4C6E-B8B3-9A3FA79F6FE3@apple.com>

 > you get something like:
 > 
 > -stack-list-locals 2 1
 > ^done,locals=[varobj= 
 > {exp="foo",value="0",name="var1",numchild="0",type="int",typecode="INT", 
 > dynamic_type="",in_scope="true",block_start_addr="0x00002c90",block_end_ 
 > addr="0x00002d10"},varobj= 
 > {exp="bar",value="0",name="var2",numchild="0",type="int",typecode="INT", 
 > dynamic_type="",in_scope="false",block_start_addr="0x00002cc4",block_end 
 > _addr="0x00002cdc"},varobj= 
 > {exp="bar",value="-1881116284",name="var3",numchild="0",type="int",typec 
 > ode="INT",dynamic_type="",in_scope="false",block_start_addr="0x00002cdc" 
 > ,block_end_addr="0x00002cf4"}]

Yes this looks exactly like what we want.

 > It would be pretty easy to add a line number for the block start &  
 > end if you wanted to show that.  We also fixed the code that reports  
 > in & out of scope pretty much along the lines that Vlad suggested a  
 > while back so you would get correct reports.  -var-update reports  
 > coming in & out of scope, but we didn't change it to report "new  
 > variables" that arise when you step into a deeper scope.  That's not  
 > necessary if you report all the blocks up-front.
 > 
 > Xcode fetches and displays ALL the locals, and then just annotates  
 > the ones that are out of scope.  But you could also imagine the UI  
 > fetching all the locals but suppressing the ones that are not in  
 > scope, and then displaying them when it gets the "in scope" message  
 > from -var-update.  We didn't do it this way because I find having the  
 > list of variables changing while stepping through code to be  
 > distracting.
 > 
 > We also didn't so a special update for locals, since Xcode keeps  
 > track of which variable objects are the locals in each frame, and  
 > updates them in batches as needed.  That coupled with the ALL_BLOCKS  
 > setting obviates the need for a special locals listing.

We (Vlad and I) could try to port this back into FSF but it would be a lot
easier (I think) for you to do it.  It seems to me that you had a good working
relationship with Andrew Cagney (perhaps from Cygnus days) and that Apple
contributed more actively to MI then.  I'm probably speaking out of order, and
maybe opening a can of worms, but I wonder if Apple could be encouraged to
contribute more actively once again if in return, say, the Apple GDB code was
given a branch on the FSF repository (see
http://sourceware.org/ml/gdb/2005-03/msg00197.html).  This would make it easier
to port changes from FSF to Apple but also Apple to FSF.

 > Another kind of useful addition along the same lines, we extended the  
 > "FRAME" argument to -var-create so you can say:
 > 
 > -var-create - +main.c:6 bar
 > 
 > to create the variable object for bar in the scope surrounding line  
 > 6.  This is necessary if you want to do variable values in tooltips  
 > using variable objects.

Yes, I see Insight uses variable objects for tooltips too.  What advantage do
they have over just using "print"?

 > For the most part, though we are a bit spotty about updating the texi  
 > docs for our MI changes, we do update the command descriptions in the  
 > mi_cmd_* source documentation (though I note there isn't much in the  
 > mi-cmd-var.c file.)

AFAICS the texi docs (gdb.texinfo) in my copy of Apple GDB
(6.3.50.20050815-cvs) are the same as in FSF.

 > If you can get your hands on a Mac OS X box for a little while, there  
 > is a way to dump the MI commands Xcode sends to gdb, and the gdb  
 > responses to a log file.  That's probably the quickest way to see  
 > what stuff we've added and how we use MI, if you are interested.

Its unlikely in the near future, but I've got OpenDarwin 7.2.1.

 > Sorry for not being active on this thread, but I've been swamped on  
 > other things, and haven't been thinking about the MI for a while now...

What about the changes that we've been making recently e.g

http://sourceware.org/ml/gdb-patches/2006-12/msg00127.html

Do they fix things for Apple too?

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


  parent reply	other threads:[~2006-12-21 23:30 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-06 10:57 Nick Roberts
2006-12-19 17:59 ` Vladimir Prus
2006-12-19 21:58   ` Nick Roberts
2006-12-20 18:39     ` Vladimir Prus
2006-12-20 20:34       ` Nick Roberts
2006-12-21  1:34         ` Nick Roberts
2006-12-21  6:34           ` Vladimir Prus
2006-12-21  7:57             ` Nick Roberts
2006-12-21  8:34               ` Vladimir Prus
2006-12-30 20:26           ` Daniel Jacobowitz
2006-12-30 20:41             ` Vladimir Prus
2006-12-30 20:50               ` Daniel Jacobowitz
2006-12-30 23:05                 ` Nick Roberts
2006-12-21  6:43         ` Vladimir Prus
2006-12-21  8:34           ` Nick Roberts
     [not found]             ` <0E190425-7C4F-4C6E-B8B3-9A3FA79F6FE3@apple.com>
2006-12-21 23:30               ` Nick Roberts [this message]
     [not found]                 ` <1B6B17FA-65DE-4CE2-9BE0-20DA74780EEA@apple.com>
2006-12-22  4:47                   ` Nick Roberts
2006-12-22  6:23                     ` Vladimir Prus
2006-12-22  6:51                       ` Nick Roberts
2006-12-22  7:30                         ` Vladimir Prus
2007-01-05  9:04             ` Vladimir Prus
  -- strict thread matches above, loose matches on Subject: below --
2006-11-29 17:21 Vladimir Prus
2006-12-05 21:16 ` Daniel Jacobowitz
2006-12-06  9:25   ` Vladimir Prus
2006-12-19 22:02     ` 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=17803.6117.15940.138752@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    --cc=jingham@apple.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