Revert "lotsa debug printing: reduce"
This reverts commit 412a9bbfc7d041fda021a86853930b3a90374458.
This commit is contained in:
parent
107521e1b2
commit
ac3e85a317
22
tccelf.c
22
tccelf.c
|
@ -337,8 +337,8 @@ static unsigned long elf_hash(const unsigned char *name)
|
|||
{
|
||||
unsigned long h = 0, g;
|
||||
|
||||
//trace_enter ("elf_hash");
|
||||
//trace ("elf_hash name="); eputs (name); eputs ("\n");
|
||||
trace_enter ("elf_hash");
|
||||
trace ("elf_hash name="); eputs (name); eputs ("\n");
|
||||
while (*name) {
|
||||
h = (h << 4) + *name++;
|
||||
g = h & 0xf0000000;
|
||||
|
@ -346,8 +346,8 @@ static unsigned long elf_hash(const unsigned char *name)
|
|||
h ^= g >> 24;
|
||||
h &= ~g;
|
||||
}
|
||||
//trace ("elf_hash h="); eputs (itoa (h)); eputs ("\n");
|
||||
//trace_exit ("elf_hash");
|
||||
trace ("elf_hash h="); eputs (itoa (h)); eputs ("\n");
|
||||
trace_exit ("elf_hash");
|
||||
return h;
|
||||
}
|
||||
|
||||
|
@ -384,7 +384,7 @@ static void rebuild_hash(Section *s, unsigned int nb_buckets)
|
|||
h = elf_hash(strtab + sym->st_name) % nb_buckets;
|
||||
#else
|
||||
h = elf_hash(strtab + sym->st_name);
|
||||
//trace ("rebuild_hash 22 h="); eputs (itoa (h)); eputs ("\n");
|
||||
trace ("rebuild_hash 22 h="); eputs (itoa (h)); eputs ("\n");
|
||||
trace ("rebuild_hash 22 nb_buckets="); eputs (itoa (nb_buckets)); eputs ("\n");
|
||||
h = h % nb_buckets;
|
||||
trace ("rebuild_hash 23 h="); eputs (itoa (h)); eputs ("\n");
|
||||
|
@ -435,7 +435,7 @@ ST_FUNC int put_elf_sym(Section *s, addr_t value, unsigned long size,
|
|||
trace ("put_elf_sym 21\n");
|
||||
ptr = section_ptr_add(hs, sizeof(int));
|
||||
trace ("put_elf_sym 22\n");
|
||||
//trace ("put_elf_sym 22 hs="); eputs (itoa (hs)); eputs ("\n");
|
||||
trace ("put_elf_sym 22 hs="); eputs (itoa (hs)); eputs ("\n");
|
||||
base = (int *)hs->data;
|
||||
trace ("put_elf_sym 23\n");
|
||||
/* only add global or weak symbols */
|
||||
|
@ -681,17 +681,17 @@ ST_FUNC int set_elf_sym(Section *s, addr_t value, unsigned long size,
|
|||
ElfW(Sym) *sym;
|
||||
#if 1
|
||||
for_each_elem(symtab_section, 1, sym, ElfW(Sym)) {
|
||||
//trace ("set_elf_sym num="); eputs (itoa (sym->st_shndx)); eputs ("\n");
|
||||
trace ("set_elf_sym num="); eputs (itoa (sym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + sym->st_name;
|
||||
//trace ("set_elf_sym name="); eputs (name); eputs ("\n");
|
||||
trace ("set_elf_sym name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
#else
|
||||
for (sym = symtab_section->data; sym < (symtab_section->data + symtab_section->data_offset); sym++) {
|
||||
//trace ("set_elf_sym num="); eputs (itoa (sym->st_shndx)); eputs ("\n");
|
||||
trace ("set_elf_sym num="); eputs (itoa (sym->st_shndx)); eputs ("\n");
|
||||
name = strtab_section->data;
|
||||
name += sym->st_name;
|
||||
//name = ((char *) strtab_section->data) + sym->st_name;
|
||||
//trace ("set_elf_sym name="); eputs (name); eputs ("\n");
|
||||
trace ("set_elf_sym name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -2859,7 +2859,7 @@ ST_FUNC int tcc_load_object_file(TCCState *s1,
|
|||
trace ("tcc_load_object_file 100\n");
|
||||
read(fd, ptr, size);
|
||||
trace ("tcc_load_object_file 101 size="); eputs (itoa (size)); eputs ("\n");
|
||||
//trace ("tcc_load_object_file 101 ptr="); eputs (ptr); eputs ("\n");
|
||||
trace ("tcc_load_object_file 101 ptr="); eputs (ptr); eputs ("\n");
|
||||
} else {
|
||||
s->data_offset += size;
|
||||
trace ("tcc_load_object_file x data_offset="); eputs (itoa (s->data_offset)); eputs ("\n");
|
||||
|
|
61
tccgen.c
61
tccgen.c
|
@ -709,6 +709,7 @@ static void vsetc(CType *type, int r, CValue *vc)
|
|||
trace ("vsetc r="); eputs (itoa (r)); eputs ("\n");
|
||||
trace ("vsetc vc->i="); eputs (itoa (vc->i)); eputs ("\n");
|
||||
trace ("vsetc vc->str.size="); eputs (itoa (vc->str.size)); eputs ("\n");
|
||||
trace ("vsetc vc->f="); eputs (itoa (vc->f)); eputs ("\n");
|
||||
trace ("vsetc vtop->r="); eputs (itoa (vtop->r)); eputs ("\n");
|
||||
trace ("vsetc vtop->type.t="); eputs (itoa (vtop->type.t)); eputs ("\n");
|
||||
trace ("vsetc vtop->r2="); eputs (itoa (vtop->r2)); eputs ("\n");
|
||||
|
@ -7243,9 +7244,9 @@ static void gen_function(Sym *sym)
|
|||
char *name;
|
||||
trace ("gen_function c="); eputs (itoa (sym->c)); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
|
||||
trace ("gen_function c="); eputs (itoa (sym->c)); eputs ("\n");
|
||||
|
@ -7261,18 +7262,18 @@ static void gen_function(Sym *sym)
|
|||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
trace ("gen_function c="); eputs (itoa (sym->c)); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
funcname = get_tok_str(sym->v, NULL);
|
||||
trace ("gen_function 04 funcname="); eputs (funcname); eputs ("\n");
|
||||
trace ("gen_function c="); eputs (itoa (sym->c)); eputs ("\n");
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
func_ind = ind;
|
||||
/* Initialize VLA state */
|
||||
|
@ -7290,9 +7291,9 @@ static void gen_function(Sym *sym)
|
|||
trace ("gen_function 10\n");
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
/* push a dummy symbol to enable local sym storage */
|
||||
sym_push2(&local_stack, SYM_FIELD, 0, 0);
|
||||
|
@ -7300,18 +7301,18 @@ static void gen_function(Sym *sym)
|
|||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
trace ("gen_function c="); eputs (itoa (sym->c)); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
local_scope = 1; /* for function parameters */
|
||||
gfunc_prolog(&sym->type);
|
||||
trace ("gen_function 13\n");
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
local_scope = 0;
|
||||
rsym = 0;
|
||||
|
@ -7319,9 +7320,9 @@ static void gen_function(Sym *sym)
|
|||
trace ("gen_function 16\n");
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
nocode_wanted = 0;
|
||||
gsym(rsym);
|
||||
|
@ -7329,26 +7330,26 @@ static void gen_function(Sym *sym)
|
|||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
trace ("gen_function c="); eputs (itoa (sym->c)); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
gfunc_epilog();
|
||||
trace ("gen_function 19\n");
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
cur_text_section->data_offset = ind;
|
||||
label_pop(&global_label_stack, NULL);
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
trace ("gen_function 21\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
/* reset local stack */
|
||||
local_scope = 0;
|
||||
|
@ -7356,9 +7357,9 @@ static void gen_function(Sym *sym)
|
|||
trace ("gen_function 23\n");
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
trace ("gen_function sym->c="); eputs (itoa (sym->c)); eputs ("\n");
|
||||
|
||||
|
@ -7371,17 +7372,17 @@ static void gen_function(Sym *sym)
|
|||
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
tcc_debug_funcend(tcc_state, ind - func_ind);
|
||||
trace ("gen_function 30\n");
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
/* It's better to crash than to generate wrong code */
|
||||
cur_text_section = NULL;
|
||||
|
@ -7392,16 +7393,16 @@ static void gen_function(Sym *sym)
|
|||
nocode_wanted = 1;
|
||||
trace ("gen_function 33\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
check_vstack();
|
||||
trace ("*** text_section="); eputs (text_section ? text_section->name : "<null>"); eputs ("\n");
|
||||
for_each_elem(symtab_section, 1, esym, ElfW(Sym)) {
|
||||
//trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
trace ("gen_function num="); eputs (itoa (esym->st_shndx)); eputs ("\n");
|
||||
name = (char *) strtab_section->data + esym->st_name;
|
||||
//trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
trace ("gen_function name="); eputs (name); eputs ("\n");
|
||||
}
|
||||
trace_exit ("gen_function");
|
||||
}
|
||||
|
|
21
tccpp.c
21
tccpp.c
|
@ -554,7 +554,7 @@ ST_FUNC const char *get_tok_str(int v, CValue *cv)
|
|||
p = cstr_buf.data;
|
||||
|
||||
trace_enter ("get_tok_str");
|
||||
//trace ("get_tok_str v="); eputs (itoa (v)); eputs ("\n");
|
||||
trace ("get_tok_str v="); eputs (itoa (v)); eputs ("\n");
|
||||
|
||||
|
||||
switch(v) {
|
||||
|
@ -664,7 +664,7 @@ ST_FUNC const char *get_tok_str(int v, CValue *cv)
|
|||
*p = '\0';
|
||||
} else if (v < tok_ident) {
|
||||
trace ("get_tok_str 03\n");
|
||||
//trace ("get_tok_str 03 v="); eputs (itoa (v)); eputs ("\n");
|
||||
trace ("get_tok_str 03 v="); eputs (itoa (v)); eputs ("\n");
|
||||
trace ("get_tok_str 03 v - TOK_IDENT="); eputs (itoa (v - TOK_IDENT)); eputs ("\n");
|
||||
#if 1
|
||||
trace ("get_tok_str 03 str="); eputs (table_ident[v - TOK_IDENT]->str) ; eputs ("\n");
|
||||
|
@ -2721,7 +2721,7 @@ static void parse_number(const char *p)
|
|||
} \
|
||||
break;
|
||||
|
||||
#if BOOTSTRAP
|
||||
#if 0 //BOOTSTRAP
|
||||
#define eputc(x)
|
||||
#define eputs(x)
|
||||
#endif
|
||||
|
@ -3263,11 +3263,6 @@ ST_FUNC void next_nomacro(void)
|
|||
trace_exit ("next_nomacro");
|
||||
}
|
||||
|
||||
#if BOOTSTRAP
|
||||
#undef eputc
|
||||
#undef eputs
|
||||
#endif
|
||||
|
||||
static void macro_subst(
|
||||
TokenString *tok_str,
|
||||
Sym **nested_list,
|
||||
|
@ -3792,11 +3787,6 @@ no_subst:
|
|||
|
||||
}
|
||||
|
||||
#if BOOTSTRAP
|
||||
#define eputc(x)
|
||||
#define eputs(x)
|
||||
#endif
|
||||
|
||||
/* return next token with macro substitution */
|
||||
ST_FUNC void next(void)
|
||||
{
|
||||
|
@ -3856,11 +3846,6 @@ ST_FUNC void next(void)
|
|||
trace_exit ("next");
|
||||
}
|
||||
|
||||
#if BOOTSTRAP
|
||||
#undef eputc
|
||||
#undef eputs
|
||||
#endif
|
||||
|
||||
/* push back current token and set current token to 'last_tok'. Only
|
||||
identifier case handled for labels. */
|
||||
ST_INLN void unget_tok(int last_tok)
|
||||
|
|
Loading…
Reference in New Issue