annotate ticoff/symtab.c @ 79:8f4996bff904

tiobjd: profile operation implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Wed, 26 Mar 2014 02:00:44 +0000
parents c2445afce514
children da103b9377e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
77
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
1 /*
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
2 * Code for working with the symbol table
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
3 */
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
4
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5 #include <sys/types.h>
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 #include <stdio.h>
79
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
7 #include <stdlib.h>
77
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 #include "filestruct.h"
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9 #include "intstruct.h"
78
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
10 #include "coffconst.h"
77
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 #include "globals.h"
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12
78
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
13 static struct classmap {
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
14 int code;
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
15 char *str;
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
16 } classtab[] = {
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
17 {C_NULL, "NULL"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
18 {C_AUTO, "AUTO"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
19 {C_EXT, "EXT"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
20 {C_STAT, "STAT"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
21 {C_REG, "REG"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
22 {C_EXTREF, "EXTREF"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
23 {C_LABEL, "LABEL"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
24 {C_ULABEL, "ULABEL"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
25 {C_MOS, "MOS"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
26 {C_ARG, "ARG"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
27 {C_STRTAG, "STRTAG"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
28 {C_MOU, "MOU"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
29 {C_UNTAG, "UNTAG"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
30 {C_TPDEF, "TPDEF"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
31 {C_USTATIC, "USTATIC"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
32 {C_ENTAG, "ENTAG"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
33 {C_MOE, "MOE"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
34 {C_REGPARM, "REGPARM"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
35 {C_FIELD, "FIELD"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
36 {C_UEXT, "UEXT"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
37 {C_STATLAB, "STATLAB"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
38 {C_EXTLAB, "EXTLAB"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
39 {C_SYSTEM, "SYSTEM"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
40 {C_VARARG, "VARARG"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
41 {C_BLOCK, "BLOCK"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
42 {C_FCN, "FCN"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
43 {C_EOS, "EOS"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
44 {C_FILE, "FILE"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
45 {C_LINE, "LINE"},
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
46 {0, 0}
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
47 };
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
48
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
49 char *
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
50 storage_class_to_string(code, numbuf)
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
51 char *numbuf;
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
52 {
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
53 struct classmap *tp;
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
54
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
55 for (tp = classtab; tp->str; tp++)
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
56 if (tp->code == code)
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
57 return(tp->str);
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
58 sprintf(numbuf, "%d", code);
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
59 return(numbuf);
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
60 }
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
61
77
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 dump_symtab()
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 {
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64 unsigned n;
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 struct internal_syment *sym;
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 char *sec, secstr[8];
78
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
67 char *class, classbuf[8];
77
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68
78
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
69 printf("%-5s %-30s %-4s %-7s %-12s %-8s\n",
77
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 "Num", "Name", "Type", "Class", "Section", "Value");
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 for (n = 0; n < nsymtab; n++) {
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 sym = symtab[n];
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 if (!sym)
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 continue;
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75 if (sym->scnum >= 1 && (unsigned)sym->scnum <= nsections)
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
76 sec = sections[sym->scnum - 1].name;
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 else {
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 sprintf(secstr, "%d", sym->scnum);
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 sec = secstr;
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80 }
78
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
81 class = storage_class_to_string(sym->class, classbuf);
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
82 printf("%-5u %-30s %04X %-7s %-12s %08X%s\n",
c2445afce514 tiobjd: symbol storage classes decoded into mnemonics
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 77
diff changeset
83 n, sym->name, sym->type, class,
77
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
84 sec, sym->value, sym->aux ? " Aux" : "");
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
85 }
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
86 return(0);
590396e27e96 tiobjd: basics dump streamlined
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 }
79
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
88
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
89 extern_profile_report(heading)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
90 char *heading;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
91 {
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
92 unsigned n;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
93 int first_extern = -1, last_extern;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
94 struct internal_syment *sym;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
95 int defs_started = 0;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
96
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
97 for (n = 0; n < nsymtab; n++) {
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
98 sym = symtab[n];
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
99 if (!sym)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
100 continue;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
101 if (sym->class != C_EXT)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
102 continue;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
103 if (sym->scnum < 0) {
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
104 fprintf(stderr,
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
105 "symbol entry #%u: unexpected negative scnum for C_EXT\n", n);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
106 exit(1);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
107 }
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
108 if (sym->scnum == 0) { /* undef external ref */
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
109 if (first_extern < 0)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
110 first_extern = n;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
111 last_extern = n;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
112 continue;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
113 }
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
114 if (!defs_started) {
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
115 printf("%s defines:\n\n", heading);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
116 defs_started = 1;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
117 }
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
118 printf("%s (%s)\n", sym->name, sections[sym->scnum - 1].name);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
119 }
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
120 if (defs_started)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
121 putchar('\n');
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
122 if (first_extern < 0)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
123 return(0);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
124 printf("%s references:\n\n", heading);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
125 for (n = first_extern; n <= last_extern; n++) {
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
126 sym = symtab[n];
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
127 if (!sym)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
128 continue;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
129 if (sym->class != C_EXT || sym->scnum)
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
130 continue;
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
131 printf("%s\n", sym->name);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
132 }
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
133 putchar('\n');
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
134 return(0);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
135 }
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
136
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
137 cmd_profile()
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
138 {
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
139 get_int_section_table();
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
140 get_int_symbol_table();
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
141 extern_profile_report(objfilename);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
142 exit(0);
8f4996bff904 tiobjd: profile operation implemented
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 78
diff changeset
143 }