Hi all. I'm not suggesting accepting this patch into tcc. This patch is for use
with my own compiler since it uses a lot of temporary variables (side effect
from the initial version only supporting llvm).
I was wondering if there's anything obviously wrong? It seems to work
perfectly. I'll be applying this patch every time I build tcc and I give it to
people using my compiler. I only tested for a few days
diff --git a/tccdbg.c b/tccdbg.c
index 9a4b26a..87f179f 100644
--- a/tccdbg.c
+++ b/tccdbg.c
@@ -1775,20 +1775,25 @@ ST_FUNC void tcc_add_debug_info(TCCState *s1, int
param, Sym *s, Sym *e)
for (; s != e; s = s->prev) {
if (!s->v || (s->r & VT_VALMASK) != VT_LOCAL)
continue;
- if (s1->dwarf) {
- tcc_debug_stabs(s1, get_tok_str(s->v, NULL),
- param ? N_PSYM : N_LSYM, s->c, NULL, 0,
- tcc_get_dwarf_info(s1, s));
- }
- else
- {
- cstr_reset (&debug_str);
- cstr_printf (&debug_str, "%s:%s", get_tok_str(s->v, NULL),
- param ? "p" : "");
- tcc_get_debug_info(s1, s, &debug_str);
- tcc_debug_stabs(s1, debug_str.data, param ? N_PSYM : N_LSYM,
- s->c, NULL, 0, 0);
- }
+ const char*varname = get_tok_str(s->v, NULL);
+ if (strncmp(varname, "_hidden", 7) == 0) {
+ //Skip debug info
+ } else {
+ if (s1->dwarf) {
+ tcc_debug_stabs(s1, varname,
+ param ? N_PSYM : N_LSYM, s->c, NULL, 0,
+ tcc_get_dwarf_info(s1, s));
+ }
+ else
+ {
+ cstr_reset (&debug_str);
+ cstr_printf (&debug_str, "%s:%s", varname,
+ param ? "p" : "");
+ tcc_get_debug_info(s1, s, &debug_str);
+ tcc_debug_stabs(s1, debug_str.data, param ? N_PSYM :
N_LSYM,
+ s->c, NULL, 0, 0);
+ }
+ }
}
cstr_free (&debug_str);
}
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel