This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] stabs: octal negative numbers
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: Jerome Guitton <guitton at act-europe dot fr>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 23 Nov 2004 09:28:35 -0500
- Subject: Re: [RFA] stabs: octal negative numbers
- References: <20041026173953.GA31663@act-europe.fr><20041123140912.GA16691@adacore.com>
I have no problems with this as long as a testcase is added.
>
> Jerome Guitton (guitton@act-europe.fr):
>
> > The patch in attachment adds support for parsing stabs that contains
> > negative numbers in octal, two's complement form. I have never
> > experienced the problem with C programs, but GCC generates those kind
> > of numbers for some Ada subtypes:
> >
> > procedure Test_Case is
> >
> > type Base_Fixed_Point_Type is
> > delta 1.0 / 16.0
> > range (System.Min_Int / 2) * 1.0 / 16.0 ..
> > (System.Max_Int / 2) * 1.0 / 16.0;
> >
> > subtype Fixed_Point_Subtype is
> > Base_Fixed_Point_Type range -50.0 .. 50.0;
> >
> > begin
> > null;
> > end Test_Case;
> >
> > The stabs generated for Fixed_Point_Subtype is:
> >
> > .stabs "test_case__fixed_point_subtype___XF_1_16:t(0,14)=@s64;r(0,12);01777777777777777776340;0000000001440;",128,0,10,0
> >
> > (01777777777777777776340 is -800 on 64-bits).
> >
> > Tested on an i686-linux host, with stabs+ format, no regressions.
> > Worth submitting an Ada test case, I guess.
> >
> > Comments? OK to apply?
> >
> > --
> > Jerome
>
> > 2004-10-26 Jerome Guitton <guitton@gnat.com>
> >
> > * stabsread.c (read_huge_number): Add support for reading octal
> > signed number in twos complement, based on the size of this
> > number.
> > (read_range_type): Add support for reading octal signed bounds
> > in twos complements, based on the size of the type.
> > (read_type_number, read_cpp_abbrev, read_member_functions,
> > read_cpp_abbrev, read_one_struct_field, read_baseclasses,
> > read_struct_type, read_array_type, read_enum_type,
> > read_sun_builtin_type, read_sun_floating_type): Update calls to
> > read_huge_number.
> > (read_type): Update call to read_range_type.
> >