On 21.08.2025 12:02, Herman ten Brugge wrote:
I debugged this and for stabs and dwarf it is used to register anon structs (struct with no definition):
Those names used in tccdbg.c are very misleading. A "struct with no definition" is "incomplete" struct s; An "anon(ymous)" struct has no tag (name): struct { int a; } s;
I created a patch (see attachment) to fix this.
That fixes some problems but not all: 1) forward decl typedef struct x1 { struct x2 *a; } x1; struct x2 { struct x1 *b; }; void f(x1 *a) { } objdump -g ... struct x1 { /* size 4 id 1 */ <undefined> *a; /* bitsize 32, bitpos 0 */ }; 2) same structs are output way too many times. You can see that with https://github.com/thradams/cake $ tcc -gdwarf -c object.c -> writes everything 10 x times (~ +400kB) $ tcc -gstabs -c object.c -> writes everything 84 x times (~ +2500kB) Well, if some forward decls don't work that's maybe not too dramatic. Maybe problem 2) can be fixed easily, don't know. Cheers, -- gr
Herman
_______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel