History

Add typedef debug info

tccgen.c: - In tcc_get_debug_info mask VT_STORAGE instead of VT_EXTERN | VT_STATIC - New function tcc_debug_typedef - Call tcc_debug_typedef in decl0

herman ten brugge committed 6 years ago

Commit 727e24c1 parent 8fd7a381 file · +17 −2Browse files

Unified · Split

tccgen.c+17−2
@@ -496,7 +496,7 @@ static void tcc_get_debug_info(TCCState *s1, Sym *s, CString *result) · 495 unmodified lines
496496 CString str;
497497
498498 for (;;) {
499− type = t->type.t & ~(VT_EXTERN | VT_STATIC | VT_CONSTANT | VT_VOLATILE);
499+ type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE);
500500 if ((type & VT_BTYPE) != VT_BYTE)
501501 type &= ~VT_DEFSIGN;
502502 if (type == VT_PTR || type == (VT_PTR | VT_ARRAY))
@@ -586,7 +586,7 @@ static void tcc_get_debug_info(TCCState *s1, Sym *s, CString *result) · 83 unmodified lines
586586 cstr_printf (result, "%d=", ++debug_next_type);
587587 t = s;
588588 for (;;) {
589− type = t->type.t & ~(VT_EXTERN | VT_STATIC | VT_CONSTANT | VT_VOLATILE);
589+ type = t->type.t & ~(VT_STORAGE | VT_CONSTANT | VT_VOLATILE);
590590 if ((type & VT_BTYPE) != VT_BYTE)
591591 type &= ~VT_DEFSIGN;
592592 if (type == VT_PTR)
@@ -666,6 +666,19 @@ static void tcc_debug_extern_sym(TCCState *s1, Sym *sym, int sh_num, int sym_bin · 73 unmodified lines
666666 cstr_free (&str);
667667 }
668668
669+static void tcc_debug_typedef(TCCState *s1, Sym *sym)
670+{
671+ CString str;
672+
673+ cstr_new (&str);
674+ cstr_printf (&str, "%s:t",
675+ (sym->v & ~SYM_FIELD) >= SYM_FIRST_ANOM
676+ ? "" : get_tok_str(sym->v & ~SYM_FIELD, NULL));
677+ tcc_get_debug_info(s1, sym, &str);
678+ tcc_debug_stabs(s1, str.data, N_LSYM, 0, NULL, 0);
679+ cstr_free (&str);
680+}
681+
669682 /* put end of translation unit info */
670683 ST_FUNC void tcc_debug_end(TCCState *s1)
671684 {
@@ -8418,6 +8431,8 @@ found: · 7746 unmodified lines
84188431 }
84198432 sym->a = ad.a;
84208433 sym->f = ad.f;
8434+ if (tcc_state->do_debug)
8435+ tcc_debug_typedef (tcc_state, sym);
84218436 } else if ((type.t & VT_BTYPE) == VT_VOID
84228437 && !(type.t & VT_EXTERN)) {
84238438 tcc_error("declaration of void object");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t