Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <muller@ics.u-strasbg.fr>
To: "'Pedro Alves'" <pedro_alves@portugalmail.pt>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [RFC] Stabs parsing regression from GDB 6.6 to GDB 6.6.90
Date: Mon, 24 Sep 2007 13:30:00 -0000	[thread overview]
Message-ID: <006701c7feae$fbb75850$f32608f0$@u-strasbg.fr> (raw)
In-Reply-To: <4053daab0709240321n40d7e3e0vc0f7d5567e990785@mail.gmail.com>



> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] On Behalf Of Pedro Alves
> Sent: Monday, September 24, 2007 12:22 PM
> To: Pierre Muller
> Cc: gdb-patches@sourceware.org
> Subject: Re: [RFC] Stabs parsing regression from GDB 6.6 to GDB 6.6.90
> 
> Pierre Muller wrote:
> >   Did you change the read_huge_number.s file manually?
> 
> Yes.
> 
> > It is as if there is an typing error for the
> > u16 type definition.
> >         .stabs  "s16:t(0,24)=@s16;r(0,24);0100000;077777;",128,0,0,0
> >         .stabs  "u16:t(0,25);r(0,25);0000000;0177777;",128,0,0,0
> > the ';' before 'r(0,25)' should be an equal sign, no?
> >
> 
> Looks like so.  You sharp eyed :)
> 
> >   One difference between my patch and yours is
> > that I think that your patch will mishandle
> > any octal number having more digits than needed,
> > because you are always considering that the
> > first char after the leading zero (to trigger octal notation)
> > contains the sign bit.
> >   For instance, your patch does not complaint about this
> >         .stabs  "t30:t(0,30)=@s8;r(0,30);02000;0077;",128,0,0,0
> > but 02000 is -1024 and does not fit into a 8 bit memory.
> >
> 
> Right.  Does this really ever happen?  A check can be added then...
  For good behaving compilers, probably not,
but it never hurts to be on the sure size and to be able
to report if some input is malformed.

  I tested the parser at command line and it seems like there 
is the same kind of flaw:
[on a i686-pc-cygwin 
(gdb) p 0x8000000000000001
$26 = 9223372036854775809
(gdb) p 0x80000000000000001
Numeric constant too large.
(gdb) p 0x800000000000000001
$27 = 1

  Even though the parser does not use read_huge_number
function (which is stabs specific) there is a similar problem 
somewhere in the parsing of constants.
  I did not get any error nor complaint for the last input...

> One can do it upfront like your patch does, or checking for
> 'n bits parsed' > size_type (is size_type > 0) after the parse loop
> should be
> enough, I guess.

  I would really appreciate that report an error
whenever the number cannot be parsed correctly.

> >   I agree that there are normally no reasons to have more digits,
> > but more  leading zeroes should not lead to an error
> 
> They don't, AFAICS.
> 
> > ... in the parsing
> > and any bit set higher that this should trigger an error.
> >
> 
> OK ...
> 
> I didn't mention why I didn't take your approach, but followed what I
> believe the
> original code intended to do:
>   - It changes the input string.  I don't believe that is correct.
> Read only data
>   comes to mind.
>   - It parses 01777777777777777776340 as an overflow (doesn't it?)
  I did not check, but I agree with you that my patch
was wrong on that part, I would just like to have the
check for the exact position of the sign bit and
that there are no bits set higher than that one.


Pierre Muller



  reply	other threads:[~2007-09-24 13:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <000e01c7fb9b$22e600f0$68b202d0$@u-strasbg.fr>
2007-09-21  8:01 ` Pierre Muller
2007-09-22  3:07   ` Pedro Alves
2007-09-22  4:20     ` Joel Brobecker
2007-09-22 10:17       ` Pedro Alves
2007-09-22 19:39     ` Pedro Alves
2007-09-22 22:58       ` Joel Brobecker
2007-09-22 23:08         ` Daniel Jacobowitz
2007-09-23  1:17           ` Joel Brobecker
2007-09-23 10:17             ` Pedro Alves
2007-09-23 11:39           ` Pedro Alves
2007-09-23 12:42             ` Daniel Jacobowitz
2007-09-23 13:57               ` Pedro Alves
2007-09-24  0:43       ` Pedro Alves
2007-09-24  9:15         ` Pierre Muller
2007-09-24 10:21           ` Pedro Alves
2007-09-24 13:30             ` Pierre Muller [this message]
2007-09-25  8:09               ` Pedro Alves
2007-09-25 23:58                 ` Pedro Alves
2007-10-03 12:06                   ` Pierre Muller
2007-10-03 16:43                     ` Jim Blandy
2007-10-03 18:44                     ` Joel Brobecker
2007-10-03 18:51                       ` Daniel Jacobowitz
2007-10-03 19:07                         ` Joel Brobecker
2007-10-03 21:36                         ` Pedro Alves
2007-10-03 21:40                           ` Daniel Jacobowitz
2007-10-05  9:59                             ` Pedro Alves
2007-10-08 23:26                               ` Pedro Alves
2007-10-09  9:10                                 ` Pierre Muller
2007-10-09 11:39                                   ` Pedro Alves
2007-09-23  1:06     ` Joel Brobecker
2007-09-24  6:57     ` Pierre Muller

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='006701c7feae$fbb75850$f32608f0$@u-strasbg.fr' \
    --to=muller@ics.u-strasbg.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro_alves@portugalmail.pt \
    /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