Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb@sources.redhat.com
Subject: Re: MI: type prefixes for values
Date: Fri, 17 Feb 2006 14:26:00 -0000	[thread overview]
Message-ID: <200602171724.03824.ghost@cs.msu.su> (raw)
In-Reply-To: <ur762gjo3.fsf@gnu.org>

On Friday 17 February 2006 17:10, Eli Zaretskii wrote:
> > From: Vladimir Prus <ghost@cs.msu.su>
> > Date: Fri, 17 Feb 2006 16:58:22 +0300
> > Cc: gdb@sources.redhat.com
> >
> > > > It's only avaiable in tooltip text for a variable. So far, no
> > > > complaints.
> > >
> > > I don't see how is this contrary to what GDB assumes.  GDB passes the
> > > information to the front end; how the front end displays it, is
> > > entirely up to the front end.
> >
> > Because for display in variable tree, frontend prefers not to show any
> > type, and for display in varible tooltips, it prefers to show the type
> > after the value, not before.
>
> That's quite specific to that front end, right?  We cannot possibly
> assume they all will behave like that.

Exactly. Then why format value in a specific way that suites some frontends, 
but not others.

> > - The parsing of that value will have to be done by ad-hoc code, which is
> > contrary to MI-goal of being easily parsable.
>
> Why ad-hoc? if you have {}, parse it, if not, don't.  Why is this
> simple rule hard for a parser?

Here's the relevant part from KDevelop:

  if (*start == '{')
    {
        // Gdb uses '{' in two cases:
        // - composites (arrays and structures)
        // - pointers to functions. In this case type is
        //   enclosed in "{}". Not sure why it's so, as
        //   when printing pointer, type is in parenthesis.
        if (type == typePointer)
        {
            // Looks like type in braces at the beginning. Strip it.
            start = skipDelim(start, '{', '}');
        }
        else
        {
            // Looks like composite, strip the braces and return.
            return QCString(start+1, end - start -1);
        }

You see, if I strip everything {}-enclosed at the beginning of value, I'll 
never show any structures. And how do I decide if the value is a pointer, or 
structure? That code was written before me, and is 100 lines in size.

And the only way to reliably tell if a variable is a pointer or not is to 
issue -var-type-info, which, according to you, is not necessary if there's {} 
in the value. Or I might look after the closing brace and see if there's 
anything there, which starts to look pretty hacky.

> > > Then perhaps we should add the type info to all arguments, instead of
> > > removing it from where it exists now.
> >
> > It might be good idea, but why don't add it as a separate field? I.e.
> > instead of
> >
> >   ^done,value="(int *) 0x0"
> >
> > you'll get
> >
> >   ^done,value="0x0",type="int *"
>
> Fine with me.

So, are patches to the effect of removing type from value, and moving it to a 
separate field welcome?

- Volodya



  reply	other threads:[~2006-02-17 14:24 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17  9:09 Vladimir Prus
2006-02-17 10:22 ` Eli Zaretskii
2006-02-17 10:29   ` Vladimir Prus
2006-02-17 11:26     ` Eli Zaretskii
     [not found]       ` <200602171450.16858.ghost@cs.msu.su>
2006-02-17 13:49         ` Eli Zaretskii
2006-02-17 13:54           ` Daniel Jacobowitz
2006-02-17 14:08             ` Eli Zaretskii
2006-02-17 13:58           ` Vladimir Prus
2006-02-17 14:11             ` Eli Zaretskii
2006-02-17 14:26               ` Vladimir Prus [this message]
2006-02-17 14:36                 ` Bob Rossi
2006-02-17 14:43                   ` Vladimir Prus
2006-02-17 14:51                     ` Bob Rossi
2006-02-17 15:02                       ` Vladimir Prus
2006-02-17 19:25                 ` Eli Zaretskii
2006-02-17 19:33                   ` Daniel Jacobowitz
2006-02-17 19:36                     ` Eli Zaretskii
2006-02-17 19:38                       ` Daniel Jacobowitz
2006-02-17 19:56                         ` Eli Zaretskii
2006-02-17 20:05                           ` Bob Rossi
2006-02-17 20:07                             ` Eli Zaretskii
2006-02-17 20:17                               ` Daniel Jacobowitz
2006-02-17 20:28                                 ` Eli Zaretskii
2006-02-17 20:33                                   ` Daniel Jacobowitz
2006-02-17 21:14                                     ` Jim Ingham
2006-02-18 11:34                                       ` Eli Zaretskii
2006-02-20 13:47                                         ` Vladimir Prus
2006-02-20  8:11                                       ` Vladimir Prus
2006-02-20 19:49                                         ` Jim Ingham
2006-02-20 20:56                                           ` Daniel Jacobowitz
2006-02-20 20:57                                             ` Jim Ingham
2006-02-21 14:15                                           ` Vladimir Prus
2006-02-21 21:33                                             ` Jim Ingham
2006-04-06 13:33                                               ` Vladimir Prus
2006-04-06 13:45                                                 ` Daniel Jacobowitz
2006-04-06 14:05                                                   ` Vladimir Prus
2006-04-06 14:31                                                     ` Daniel Jacobowitz
2006-04-06 15:05                                                       ` Vladimir Prus
2006-04-06 15:32                                                         ` Daniel Jacobowitz
2006-04-06 18:53                                                           ` Jim Ingham
2006-04-06 16:49                                                     ` Jim Ingham
2006-04-06 16:49                                                       ` Daniel Jacobowitz
2006-04-06 16:52                                                         ` Jim Ingham
2006-04-06 18:58                                                 ` Jim Ingham
2006-04-07  8:13                                                   ` Vladimir Prus
2006-04-07 20:08                                                     ` Jim Ingham
2006-04-12 15:38                                                       ` Vladimir Prus
2006-04-12 19:41                                                         ` Jim Ingham
2006-04-13 16:15                                                           ` Vladimir Prus
2006-02-17 21:19                                     ` Daniel Jacobowitz
2006-02-17 20:20                               ` Bob Rossi
2006-02-17 20:47                                 ` Daniel Jacobowitz
2006-02-17 19:44                       ` Bob Rossi
2006-02-17 19:59                         ` Eli Zaretskii
2006-02-20  7:28                         ` Vladimir Prus
2006-02-20 23:37                           ` Eli Zaretskii
2006-02-21  4:13                             ` Daniel Jacobowitz
2006-02-21 14:15                               ` Vladimir Prus
2006-02-21 20:41                                 ` Daniel Jacobowitz
2006-02-20 13:48                   ` Vladimir Prus
2006-02-17 11:27     ` Nick Roberts

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=200602171724.03824.ghost@cs.msu.su \
    --to=ghost@cs.msu.su \
    --cc=eliz@gnu.org \
    --cc=gdb@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