GCC routinely puts on the fly type description in other stabs. For example,

    0000006c - 00 0002  PSYM argv:p(0,2)=*(0,3)=*(0,4)=r(0,4);0;127;

Now when this PSYM stab is discarded by linker the useful type info is lost. This happens a lot in -feliminate-unused-debug-symbols mode. It happens even more in GCC-4.0 compared to GCC-3.3. Plus it is useful to put avoid on the fly type descriptions for the Essential Symbols work done here at Apple. And one small thing, it is less confusing to GDB when type is described first before being used. (And that is in -feliminate-unused-debug-symbols mode :)). So instead of generating these stabs

00000000 - 01 0003   FUN main:F(0,1)
00000000 - 00 0000  LSYM int:t(0,1)=r(0,1);-2147483648;2147483647;
00000068 - 00 0002  PSYM argc:p(0,1)
0000006c - 00 0002  PSYM argv:p(0,2)=*(0,3)=*(0,4)
00000000 - 00 0000  LSYM char:t(0,4)=r(0,4);0;127;
0000004c - 00 0000   FUN

It is desirable that GCC produces this

00000000 - 01 0003   FUN main:F(0,1)
00000068 - 00 0002  PSYM argc:p(0,1)
0000006c - 00 0002  PSYM argv:p(0,2)
00000000 - 00 0000  LSYM int:t(0,1)=r(0,1);-2147483648;2147483647;
00000000 - 00 0000  LSYM :t(0,2)=*(0,3)
00000000 - 00 0000  LSYM :t(0,3)=*(0,4)
00000000 - 00 0000  LSYM char:t(0,4)=r(0,4);0;127;
0000004c - 00 0000   FUN

I've now patch ready (based on apple-local-200502-branch) but it requires few bug fixes in darwin GDB. My simple question is : Is anybody interested in reviewing this GCC patch for acceptance in FSF GCC (4.1 or 4.2 or whenever) irrespective of whether associated GDB changes are contributed or not? Apple linker is updated to avoid 't' and 'T' LSYM stabs while removing chunks of stabs. I am not sure how big deal it is for FSF linker. And I do not know whether these linker changes will find its way in FSF linker or not.

I know, this is about stabs and not many folks care about stabs. And on top of that it is related to -feliminate-unused-debug-symbols mode mainly. Plus issue of getting other tools on the same page. So I'd like to understand the interest before sending patch (and later on annoying ping messages :) ).

[ Do not say anything about switching to Dwarf. Other folks here at Apple are working on it. ]
-
Devang

Reply via email to