This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [RFC] Stabs parsing regression from GDB 6.6 to GDB 6.6.90


  

> -----Original Message-----
> From: Pedro Alves [mailto:alves.ped@gmail.com] On Behalf Of Pedro Alves
> Sent: Saturday, September 22, 2007 5:06 AM
> To: Pierre Muller
> Cc: gdb-patches@sourceware.org
> Subject: Re: [RFC] Stabs parsing regression from GDB 6.6 to GDB 6.6.90
> 
> Hi,
> 
> This afects Cygwin badly, as it still uses stabs by default.
> I've seen this problem here, but thought it was caused by a few gcc
> changes I was making ...
> 
> Pierre Muller wrote:
> >   As I was unable to understand the current implementation of the
> > twos_complement_representation
> 
> I can't really see how it was supposed to work either.
> Parsing 000000000 is broken currently.
> 
> > I rewrote it almost completely.
> 
> You are only counting the bits.  This function should return the parsed
> number if it fits in a long:

  My idea was to clear the sign bit and
let the normal code handle the parsing of the value,
but I completely forgot that two complement notation
is not the same as the multiplication by -1.
  So I should probably have let the sign bit and parse it
as an unsigned integer.


> /* If TWOS_COMPLEMENT_BITS is set to a strictly positive value and if
>      the number is represented in an octal representation, assume that
>      it is represented in a 2's complement representation with a size
> of
>      TWOS_COMPLEMENT_BITS.
> 
>      If the number fits in a long, set *BITS to 0 and return the value.
>      If not, set *BITS to be the number of bits in the number and
> return 0.
> 
>      If encounter garbage, set *BITS to -1 and return 0.  */
> 
> 
> >   The code now checks that the most significant bit of the whole
> octal
> > representation of the huge number that is being parsed is exactly at
> > the bit position given by the twos_complement_bits parameter.
> >
> 
> >   The attached patch (against 6.6.90 source) fixes the problem that I
> > describe in the previous email. I get no complaint for the 'unsigned
> > long long' type compiled with '-gstabs+' option.
> >
> 
> Thanks for pointing in the right direction!
> 
> (Forgive me for counter patching, but I had started on this
>   here too yesterday :( )

 As nobody reacted on my first email,
I thought that nobody cared.
  I am glad you propose a new patch.
As you already proposed a second one,
I will try to comment on that one directly.

Thanks

Pierre Muller



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]