"RAHUL V R" <[EMAIL PROTECTED]> writes: > > On 05 Dec 2006 07:05:33 -0800, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: > > "RAHUL V R" <[EMAIL PROTECTED]> writes: > > > I am working on adding a new data type in gcc under C. > > > Please tell me, if I don't want to use the debugging info/format in > > > DBX, but still I want to build gcc in cygwin what changes should be made > > > on > > > dbxout.c? Is it compulsory that I have to provide support in dbxout.c? > > Changing dbxout.c is only compulsory if you want to support -gstabs. > > Please refer the following test program: > " > int main(){ > int j=10; > return 0;} > " > > When the above program was compiled with 'gstabs' [using gcc 4.1.1], > I got assembly code with debugging info (for DBX) like:
Why are you compiling with -gstabs? Why not use DWARF? > .stabs "int:t(0,1)=r(0,1);-2147483648;2147483647;",128,0,0,0 > .stabs "char:t(0,2)=r(0,2);0;255;",128,0,0,0 > .stabs "long int:t(0,3)=r(0,3);-2147483648;2147483647;",128,0,0,0 > : > : > .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 > .stabs "double:t(0,13)=r(0,1);8;0;",128,0,0,0 > .stabs "long double:t(0,14)=r(0,1);8;0;",128,0,0,0 > : > : > " > Why is it ' ."float:t(0,12)=r(0,1) ..", > ."double:t(0,13)=r(0,1) .." ' ? http://sources.redhat.com/gdb/current/onlinedocs/stabs_5.html#SEC33 > (Why float(12), double(13), long double(14) is equated to int type(1)?) > Or why is it not ' ."float:t(0,12)=r(0,12) ..", > ..."double:t(0,13)=r(0,13) ." ..' ? It's convention. Builtin types can always be described as subranges of 'int'. > What should be done in case if a new data type is added? > For example what additions/changes will be made in the above function > for Decimal Float types and Fixed Point Types in gcc 4.3/4.4? First you have to define what those types should look like in stabs format. Then you have to change gcc to generate that format, and change gdb to read that format. I know this is not helpful, but unfortunately stabs doesn't have any way to define a type like decimal float or fixed point. You are going to have to decide what it should do. One possibility would be to invent a new floating point type, and use something like "R7;8;". > > If you want to contribute your changes back (from your brief description, > > that would not be an easy sell), then you need to make sure that dbxout.c > > doesn't > > crash, but you don't necessarily need to put full support there. > > Please explain what you mean by "not giving full support" I was assuming that you didn't care about -gstabs. Most people don't use it these days. Ian