From: Daniel Berlin <dberlin@redhat.com>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: zackw@stanford.edu, gdb-patches@sources.redhat.com
Subject: Re: Option to elide single-bit bitfields when printing structures
Date: Fri, 23 Feb 2001 07:03:00 -0000 [thread overview]
Message-ID: <x7elwph275.fsf@dynamic-addr-83-177.resnet.rochester.edu> (raw)
In-Reply-To: <200102230756.CAA06304@indy.delorie.com>
Eli Zaretskii <eliz@delorie.com> writes:
> > From: "Zack Weinberg" <zackw@stanford.edu>
> > Date: Thu, 22 Feb 2001 11:56:33 -0800
> >
> > (gdb) p decl->common
> > $1 = {chain = 0x40253000, type = 0x40253138, code = FUNCTION_DECL,
> > side_effects_flag = 0, constant_flag = 0, addressable_flag = 0,
> > volatile_flag = 0, readonly_flag = 0, unsigned_flag = 0,
> > asm_written_flag = 0, used_flag = 0, nothrow_flag = 0, static_flag = 0,
> > public_flag = 1, private_flag = 0, protected_flag = 0, bounded_flag = 0,
> > lang_flag_0 = 0, lang_flag_1 = 0, lang_flag_2 = 0, lang_flag_3 = 0,
> > lang_flag_4 = 0, lang_flag_5 = 0, lang_flag_6 = 0, dummy = 0}
> >
> > It's hard to see which are set and which aren't. With this patch, you
> > can get it printed like this:
> >
> > (gdb) set print elide-bitflags on
> > (gdb) p decl->common
> > $2 = {chain = 0x40253000, type = 0x40253138, code = FUNCTION_DECL, public_flag}
> >
> > which is, IMHO, much easier to read.
>
> What if someone wants to know which flags are _reset_?
Nobody really does, it wouldn't make sense.
You know what isn't set because it's not shown.
> What if there
> are more than one set flag in your example?
There is.
> What if the bit fields
> span more than one bit?
It prints them the normal way.
> I don't see how your suggestion would deal
> with these cases in a way that the resulting display is
> self-explaining. That trailing "public_flag" is already hard to
> understand; I stared at it for a few moments without understanding
> what's going on here, before it hit me.
>
> Perhaps we need a special command or a special format that would put
> the burden on the user. For example, if the user specifies exactly
> what flags (set or unset) does she want to see, the display doesn't
> need to explain that, because the user asked for it.
Errr, it only elides the display if you set a command specifically.
It defaults to the old behavior.
next parent reply other threads:[~2001-02-23 7:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20010222115633.B11707@wolery.stanford.edu>
[not found] ` <200102230756.CAA06304@indy.delorie.com>
2001-02-23 7:03 ` Daniel Berlin [this message]
[not found] ` <6137-Fri23Feb2001183455+0200-eliz@is.elta.co.il>
2001-02-24 13:10 ` Zack Weinberg
2001-02-24 23:53 ` Eli Zaretskii
2001-02-27 0:17 ` Zack Weinberg
2001-02-27 11:04 ` Eli Zaretskii
2001-02-27 11:44 ` Daniel Berlin
2001-02-27 14:41 ` Michael Snyder
2001-02-23 10:09 ` Michael Snyder
2001-02-24 13:05 ` Zack Weinberg
2001-02-24 23:54 ` Eli Zaretskii
2001-02-27 0:13 ` Zack Weinberg
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=x7elwph275.fsf@dynamic-addr-83-177.resnet.rochester.edu \
--to=dberlin@redhat.com \
--cc=eliz@is.elta.co.il \
--cc=gdb-patches@sources.redhat.com \
--cc=zackw@stanford.edu \
/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