From: Daniel Jacobowitz <drow@mvista.com>
To: Pierre Muller <muller@cerbere.u-strasbg.fr>
Cc: Michal Ludvig <mludvig@suse.cz>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] New bitflags type and eflags on i386/x86-64
Date: Mon, 29 Apr 2002 10:17:00 -0000 [thread overview]
Message-ID: <20020429131522.A1298@nevyn.them.org> (raw)
In-Reply-To: <4.2.0.58.20020429180717.020bacb0@ics.u-strasbg.fr>
On Mon, Apr 29, 2002 at 06:52:08PM +0200, Pierre Muller wrote:
> At 17:45 22/04/2002 , Daniel Jacobowitz a écrit:
> >On Mon, Apr 22, 2002 at 05:15:34PM +0200, Michal Ludvig wrote:
> > > Hi all,
> > > I've created a new typecode TYPE_CODE_FLAGS with appropriate functions
> > > and used it in builtin_type_i386_eflags type. I did this to be able to
> > > print i386's and x86-64's FLAGS register in a symbolic form, instead of
> > > printing it in a hexadecimal and decimal notation.
> > >
> > > Now it looks like this:
> > > (gdb) info registers eflags
> > > eflags 0x747 [ DF IF TF ZF PF CF ]
> > >
> > > I've chosen quite a generic way for implementation, so that the others
> > > could use this for their types as well. For now I'm using this type
> > > only on x86-64, but using it on i386 should be possible without
> > > modifications. (BTW Should I do it or the maintainer will?)
> > >
> > > Any comments? Can I commit?
> >
> >First of all, please include ChangeLog entries; it makes patches easier
> >to digest quickly.
> >
> >Second, I see that you assume a TYPE_CODE_FLAGS type is the size of a
> >long. I'm not fond of that. I would prefer if you instead added
> >support to c-valprint.c for something like Pascal's TYPE_CODE_SET (see
> >p-valprint.c) and used that. It should be exactly what you're looking
> >for. Basically, you create an enum describing the bit position (not
> >mask) for each flag, and then call create_set_type with that type as
> >the domain_type.
>
> Beware that if you try to use this in C language,
> you will get an error that C language doesn't know anything about TYPE_CODE_SET.
> Furthermore, if you force the use of the pascal version of printing sets,
> you are still not safe:
> Pascal set valprint code does print a set with ranges:
> if you have a pascal type
> tset = set of [1..16];
> and a variable a of type tset, that contains
> 2,5,6,7,8,15
> it will be dispalyed as
> [2,5..8,15]
> this is also the case for enumerated flags,
> but this is bad for the flag enumeration.
Sure it is. I'd rather simply fix this for enumerated flags, which it
does not make sense to abbreviate in this fashion.
> Given this info, I would support the creation of a TYPE_CODE_FLAGS
> rather than trying to use pascal sets.
> Note that the code submitted does failm to write the flags if language is set to
> pascal for instance... So this means that the p-valprint and
> maybe others (f-valprint or jv-valprint code should be adapted too).
> So maybe the best would be to move thiscode from c-valprint.c to valprint.c
> and simply call it for the different language-valprint.c sources.
Yes, certainly. Probably even for TYPE_CODE_SET, which I still prefer.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2002-04-29 17:17 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-22 8:15 Michal Ludvig
2002-04-22 8:45 ` Daniel Jacobowitz
2002-04-22 9:08 ` Michal Ludvig
2002-04-22 19:05 ` Andrew Cagney
2002-04-22 21:28 ` Daniel Jacobowitz
2002-04-23 6:22 ` Michal Ludvig
2002-04-23 7:32 ` Daniel Jacobowitz
2002-04-29 9:54 ` Pierre Muller
2002-04-29 10:11 ` Michal Ludvig
2002-04-29 10:17 ` Daniel Jacobowitz [this message]
2002-04-22 8:35 Michal Ludvig
2002-08-27 14:50 ` Andrew Cagney
2002-08-28 7:48 ` Michal Ludvig
2002-08-28 8:08 ` Daniel Jacobowitz
2002-08-28 8:09 ` Michal Ludvig
2002-08-28 10:03 ` Andrew Cagney
2002-08-29 7:20 ` Michal Ludvig
2002-08-29 7:57 ` Daniel Jacobowitz
2002-08-29 8:03 ` Michal Ludvig
2002-08-29 8:15 ` Daniel Jacobowitz
2002-08-29 8:59 ` Andrew Cagney
2002-08-29 16:37 ` Mark Kettenis
2002-08-30 7:09 ` Michal Ludvig
2002-08-30 7:05 ` Michal Ludvig
2002-08-30 7:12 ` Pierre Muller
2002-08-30 7:41 ` Michal Ludvig
2002-08-30 8:14 ` Daniel Jacobowitz
2002-08-30 10:18 ` Pierre Muller
2002-09-03 2:17 ` Michal Ludvig
2002-09-03 5:30 ` Daniel Jacobowitz
2002-09-05 1:04 ` Michal Ludvig
2002-09-06 13:01 ` Mark Kettenis
2002-09-09 20:35 ` Andrew Cagney
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=20020429131522.A1298@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=mludvig@suse.cz \
--cc=muller@cerbere.u-strasbg.fr \
/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