This is the mail archive of the gdb-patches@sources.redhat.com 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]

[RFA] stabs: octal negative numbers


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

Attachment: stabsread.dif
Description: Text document


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