Hello, Kindly answer my below query on: "modifications required on 'dbxout.c', while adding a new data type in gcc under C"
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: " .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)….." …' ? (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)…." ..' ? Then I found the following in 'dbxout.c' [in function 'dbxout_type ()']: " switch (TREE_CODE (type)) { : : case REAL_TYPE: /* This used to say `r1' and we used to take care to make sure that `int' was type number 1. */ stabstr_C ('r'); dbxout_type_index (integer_type_node); stabstr_C (';'); stabstr_D (int_size_in_bytes (type)); stabstr_S (";0;"); break; : : " Why is it 'integer_type_node' in 'case REAL_TYPE:' ? 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?
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" Thank You & Kind Regards, rahul