Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@ics.u-strasbg.fr>
To: Daniel Jacobowitz <drow@mvista.com>, Michal Ludvig <mludvig@suse.cz>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] New bitflags type and eflags on i386/x86-64
Date: Fri, 30 Aug 2002 10:18:00 -0000	[thread overview]
Message-ID: <4.2.0.58.20020830164921.01c6fba8@ics.u-strasbg.fr> (raw)
In-Reply-To: <20020830144216.GA13476@nevyn.them.org>

At 16:42 30/08/2002 , Daniel Jacobowitz a écrit:
>On Fri, Aug 30, 2002 at 04:32:21PM +0200, Michal Ludvig wrote:
> > Pierre Muller wrote:
> > >  set $eflags &=0xfffe
> > >if you wanted to clear the flag at position zero.
> > >Will this still be possible without typecasting the flag register ?
> > 
> > Well ... no. But at least
> > set (int)$eflags &=0xfffe
> > works.

That one was finally easy to solve :
(I still have the old version of the patch on my computer...)
The following patch was enough to get
set $eflags &= 0xfffe
to work again...
it just allows TYPE_CODE_FLAGS to be considered as an integer type for binary operations
maybe some other small similar changes are required for unary operations,
but it should be easy to solve !

Index: valarith.c
===================================================================
RCS file: /cvs/src/src/gdb/valarith.c,v
retrieving revision 1.16
diff -u -p -r1.16 valarith.c
--- valarith.c  1 Aug 2002 17:18:33 -0000       1.16
+++ valarith.c  30 Aug 2002 15:08:38 -0000
@@ -755,12 +755,14 @@ value_binop (struct value *arg1, struct
    type2 = check_typedef (VALUE_TYPE (arg2));

    if ((TYPE_CODE (type1) != TYPE_CODE_FLT
+       && TYPE_CODE (type1) != TYPE_CODE_FLAGS
         && TYPE_CODE (type1) != TYPE_CODE_CHAR
         && TYPE_CODE (type1) != TYPE_CODE_INT
         && TYPE_CODE (type1) != TYPE_CODE_BOOL
         && TYPE_CODE (type1) != TYPE_CODE_RANGE)
        ||
        (TYPE_CODE (type2) != TYPE_CODE_FLT
+       && TYPE_CODE (type2) != TYPE_CODE_FLAGS
         && TYPE_CODE (type2) != TYPE_CODE_CHAR
         && TYPE_CODE (type2) != TYPE_CODE_INT
         && TYPE_CODE (type2) != TYPE_CODE_BOOL


>You should be able to make the parser promote an lvalue of
>TYPE_CODE_FLAGS to TYPE_CODE_INT...

The above should be easy to generalize.

> > >or willsomething like
> > >   set $eflags = $eflags | [ZF]
> > >be possible ?
> > 
> > I don't know how to do this :-(
>
>This requires the parser for a given language to support creating
>TYPE_CODE_FLAGS.  Not necessarily a good idea, our C parser is
>delicate enough already.

I completely agree that it a bad idea, mainly because it would add 
some new names that could conflict with program variables...
But I think that getting TYPE_CODE_FLAGS to be aconsidered as an
integer type for all but display should not be so hard, 
and this will remove a potential source of future bug reports
about :
   I can manipulate the $eflags register anymore
or:
  My ten years old GDB script issues an error in GDB 5.3 ...


>-- 
>Daniel Jacobowitz
>MontaVista Software                         Debian GNU/Linux Developer



Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


  reply	other threads:[~2002-08-30 15:14 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
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

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=4.2.0.58.20020830164921.01c6fba8@ics.u-strasbg.fr \
    --to=muller@ics.u-strasbg.fr \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mludvig@suse.cz \
    /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