FreeCalypso > hg > freecalypso-reveng
comparison ticoff/basics.c @ 75:1a23ff9a81de
tiobjd: dumpsym implemented
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Tue, 25 Mar 2014 20:38:31 +0000 |
parents | 2eef88395908 |
children | 590396e27e96 |
comparison
equal
deleted
inserted
replaced
74:2eef88395908 | 75:1a23ff9a81de |
---|---|
40 printf("\t%u reloc, %u line entries\n", | 40 printf("\t%u reloc, %u line entries\n", |
41 inf->nreloc, inf->nlineent); | 41 inf->nreloc, inf->nlineent); |
42 } | 42 } |
43 exit(0); | 43 exit(0); |
44 } | 44 } |
45 | |
46 cmd_dumpsym() | |
47 { | |
48 unsigned n; | |
49 struct internal_syment *sym; | |
50 char *sec, secstr[8]; | |
51 | |
52 get_int_section_table(); | |
53 get_int_symbol_table(); | |
54 printf("%-5s %-24s %-4s %-5s %-12s %-8s\n", | |
55 "Num", "Name", "Type", "Class", "Section", "Value"); | |
56 for (n = 0; n < nsymtab; n++) { | |
57 sym = symtab[n]; | |
58 if (!sym) | |
59 continue; | |
60 if (sym->scnum >= 1 && (unsigned)sym->scnum <= nsections) | |
61 sec = sections[sym->scnum - 1].name; | |
62 else { | |
63 sprintf(secstr, "%d", sym->scnum); | |
64 sec = secstr; | |
65 } | |
66 printf("%-5u %-24s %04X %-5d %-12s %08X%s\n", | |
67 n, sym->name, sym->type, sym->class, | |
68 sec, sym->value, sym->aux ? " Aux" : ""); | |
69 } | |
70 exit(0); | |
71 } |