Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb-patches@sources.redhat.com
Subject: Re: variable objects and registers
Date: Tue, 19 Dec 2006 21:58:00 -0000	[thread overview]
Message-ID: <17800.24415.300779.516967@kahikatea.snap.net.nz> (raw)
In-Reply-To: <E1GwjEo-00030H-Me@zigzag.lvk.cs.msu.su>

 > ? Or maybe we should not mix easy "create one varobj from expression"
 > command with "create a bunch of varobj" command and add the following:
 > 
 >         -var-create-and-list --registers ...
 >         -var-create-and-list --locals ...
 >         -var-create-and-list --whatever-else ...

A separate command does indeed seem best.

 > or just "-var-list"? On the other hand, on Apple branch the varobjs for
 > locals are created using
 > 
 >         -stack-list-locals --make-varobjs

Most of the functionality seems to come from varobj.c so, unless Apple
contribute this code to the FSF repository, I see no need to follow their
approach.

 > I slightly prefer
 > 
 >         -var-list --locals

-var-list-create --locals?  -var-create-list --locals?

Insight creates variable objects for display of locals.  The delay is quite
apparent when there are more than a couple of them, but it only updates when
the frame changes.  In Emacs, I update after every GDB command using "info
locals" which is quicker but not as good.  We need to find a way to detect when
the frame changes and report it e.g

   * NOTIFY-ASYNC-OUTPUT contains supplementary information that the
     client should handle (e.g., a new breakpoint information).  All
     notify output is prefixed by `='.

=frame-changed

I started looking at this in the thread

http://sourceware.org/ml/gdb/2006-06/msg00162.html

but didn't make good progress.

 > >...
 > > +static struct varobj *
 > > +create_varobj_in_frame (char *name, char *expression, char *frame)
 > > +{
 > > +  CORE_ADDR frameaddr = 0;
 > > +  struct cleanup *cleanup;
 > > +  enum varobj_type var_type;
 > > +
 > > +  if (strcmp (frame, "*") == 0)
 > > +    var_type = USE_CURRENT_FRAME;
 > > +  else if (strcmp (frame, "@") == 0)
 > > +    var_type = USE_SELECTED_FRAME;
 > > +  else
 > > +    {
 > > +      var_type = USE_SPECIFIED_FRAME;
 > > +      frameaddr = string_to_core_addr (frame);
 > > +    }
 > > +
 > > +  if (varobjdebug)
 > > +    fprintf_unfiltered (gdb_stdlog,
 > > +                 "Name=\"%s\", Frame=\"%s\" (0x%s), Expression=\"%s\"\n",
 > > +                     name, frame, paddr (frameaddr), expression);
 > > +
 > > +  return varobj_create (name, expression, frameaddr, var_type);
 > > +}
 > > +
 > > 
 > > I think the function above should go in varobj.c
 > 
 > Then, the varobj.c would have to expose magic "@" and "*" values in its
 > interface. I think it's better to keep this closer to parsing code and keep
 > varobj.c separated.

Yes.  OK, in that case I would call the function create_var_in_frame.  Likewise
with existing functions:

varobj_update_one    -->  var_update
print_varobj         -->  print_var

so that they are in the file you would expect to find them.

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


  reply	other threads:[~2006-12-19 21:58 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 [this message]
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
     [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=17800.24415.300779.516967@kahikatea.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    /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