Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Ken Werner <ken@linux.vnet.ibm.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: shrink main_type
Date: Fri, 01 Oct 2010 13:23:00 -0000	[thread overview]
Message-ID: <201010011523.00064.ken@linux.vnet.ibm.com> (raw)
In-Reply-To: <20100930175518.GA2976@adacore.com>

On Thursday, September 30, 2010 7:55:18 pm Joel Brobecker wrote:
> I'm sorry about the delay in getting to this. I hope it's something
> temporary that we all seem to be busier than usual.

Thanks for taking a look at this.

> > One approach to restore that functionality would be to move the
> > nottext flag into to the instance_flags of the type. Attached is an
> > untested patch of what I have in mind. Comments are welcome.

> It took me a while to figure out why this is necessary. Initially,
> I thought that the vector type should have the NOTTEXT bit set,
> but that wouldn't be sufficient for the case where we just print
> one element of the vector (because we'd end up checking type of
> the element and not find the NOTTEXT bit set, and thus print it
> as a character rather than an integer.
>
> Do I understand the situation correctly? If yes, can we add a test
> that checks that, if not already there?

I think you are right because c_textual_element_type queries the type of the 
element to be printed. In case a single element of the vector is printed it is 
the type of the vectors target type. Printing of character vectors is only 
tested indirectly through gdb.arch/altivec-abi.exp. I think it would be good 
to add a few tests to gdb.base/gnu_vector.exp.

> Based on that understanding, then I agree that the NOTTEXT flag
> seems to be more of an instance flag than a type flag.  The code
> in make_vector_type seems to be confirming that.
> 
> If you make a proper submission for this patch, I will officially
> review it.

When I first realized that printing of char vectors is awkward I attempted to 
fix this at c-valprint (http://sourceware.org/ml/gdb-
patches/2010-06/msg00573.html) but overlooked that there already is a 
mechanism for that. Then I learned about the NOTTEXT flag and thought Toms 
shrink-main_type-patch broke the char vector printing and revived this mail 
thread. Now I think this never worked because even the initial patch from Jan  
(http://sourceware.org/ml/gdb-patches/2007-08/msg00467.html) writes the 
nottext bit into the instance flags (make_vector_type) but  the 
textual_element_type function checks for a type flag. I think that moving 
nottext flag into to the instance_flags of the type is a good way to fix this. 
I'll post a proper patch soon.

Thanks
-ken


  reply	other threads:[~2010-10-01 13:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-17 18:50 Tom Tromey
2008-08-18 13:01 ` Joel Brobecker
2008-08-18 13:20   ` Daniel Jacobowitz
2008-08-18 13:30     ` Joel Brobecker
2008-08-18 15:19     ` Tom Tromey
2008-08-18 19:39       ` Tom Tromey
2008-08-18 22:17         ` Andreas Schwab
2008-08-18 22:32           ` Daniel Jacobowitz
2008-08-19  5:13         ` Joel Brobecker
2008-08-19 17:56           ` Tom Tromey
2008-08-24 10:12             ` Joel Brobecker
2008-08-24 16:41               ` Tom Tromey
2008-08-24 18:03                 ` Tom Tromey
2008-08-24 20:35                   ` Tom Tromey
2008-08-25 15:50                     ` Joel Brobecker
2008-08-25 19:12                       ` Tom Tromey
2010-09-15 19:23             ` Ken Werner
2010-09-25 14:38               ` Ken Werner
2010-09-30 18:56               ` Joel Brobecker
2010-10-01 13:23                 ` Ken Werner [this message]
2010-10-01 15:34                 ` [patch] move the nottext flag to the instance_flags Ken Werner
2010-10-01 16:15                   ` Joel Brobecker
2010-10-05 21:50                     ` Tom Tromey
2010-10-06  8:45                       ` Ken Werner
2008-08-18 15:04   ` RFA: shrink main_type Tom Tromey

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=201010011523.00064.ken@linux.vnet.ibm.com \
    --to=ken@linux.vnet.ibm.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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