view leo-obj/tool/ln.c @ 150:df01a4f4c272

tiobjd disasm -g: dump of function locals implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Tue, 29 Apr 2014 07:51:28 +0000
parents fbdb7686a9e9
children fcf1ef773a57
line wrap: on
line source

/*
 * Dumping of line number records
 */

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include "filestruct.h"
#include "intstruct.h"
#include "coffconst.h"
#include "globals.h"

extern unsigned get_u16(), get_u32();

cmd_ln()
{
	unsigned n, m;
	struct internal_scnhdr *sec;
	u_char *rec;

	get_int_section_table();
	for (n = 0; n < nsections; n++) {
		sec = sections + n;
		if (!sec->nlineent)
			continue;
		printf("%s:\n\n", sec->name);
		rec = filemap + sec->line_offset;
		for (m = 0; m < sec->nlineent; m++, rec += 6)
			printf("%08X  %04X\n", get_u32(rec), get_u16(rec + 4));
		putchar('\n');
	}
	exit(0);
}