FreeCalypso > hg > freecalypso-reveng
comparison objgrep/dumpmatch.c @ 171:ddbfc1a1a811
objgrep: -s implemented
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Fri, 04 Jul 2014 03:07:09 +0000 |
parents | |
children | 452baa748747 |
comparison
equal
deleted
inserted
replaced
170:13a9ce1590fc | 171:ddbfc1a1a811 |
---|---|
1 /* | |
2 * objgrep: output on matches | |
3 */ | |
4 | |
5 #include <sys/types.h> | |
6 #include <stdio.h> | |
7 #include <stdint.h> | |
8 #include <stdlib.h> | |
9 #include <string.h> | |
10 #include <strings.h> | |
11 #include "intstruct.h" | |
12 #include "coffconst.h" | |
13 #include "globals.h" | |
14 | |
15 extern unsigned get_u16(), get_u32(); | |
16 | |
17 dump_symtab_on_match() | |
18 { | |
19 unsigned n; | |
20 struct internal_syment *sym; | |
21 | |
22 printf("\nThis source section's symbols:\n\n"); | |
23 for (n = 0; n < nsymtab; n++) { | |
24 sym = symtab[n]; | |
25 if (!sym) | |
26 continue; | |
27 if (sym->section != grep_section) | |
28 continue; | |
29 switch (sym->class) { | |
30 case C_EXT: | |
31 printf("%s = %08X\n", sym->name, | |
32 sym->value + match_offset); | |
33 continue; | |
34 case C_STAT: | |
35 printf("%s:%s = %08X\n", objfilename, sym->name, | |
36 sym->value + match_offset); | |
37 continue; | |
38 } | |
39 } | |
40 } |