comparison leo-obj/tool/ln.c @ 143:fbdb7686a9e9

tiobjd: raw dump of line number records implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 28 Apr 2014 05:55:40 +0000
parents
children fcf1ef773a57
comparison
equal deleted inserted replaced
142:ed533d469838 143:fbdb7686a9e9
1 /*
2 * Dumping of line number records
3 */
4
5 #include <sys/types.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include "filestruct.h"
9 #include "intstruct.h"
10 #include "coffconst.h"
11 #include "globals.h"
12
13 extern unsigned get_u16(), get_u32();
14
15 cmd_ln()
16 {
17 unsigned n, m;
18 struct internal_scnhdr *sec;
19 u_char *rec;
20
21 get_int_section_table();
22 for (n = 0; n < nsections; n++) {
23 sec = sections + n;
24 if (!sec->nlineent)
25 continue;
26 printf("%s:\n\n", sec->name);
27 rec = filemap + sec->line_offset;
28 for (m = 0; m < sec->nlineent; m++, rec += 6)
29 printf("%08X %04X\n", get_u32(rec), get_u16(rec + 4));
30 putchar('\n');
31 }
32 exit(0);
33 }