# HG changeset patch # User Michael Spacefalcon # Date 1398664540 0 # Node ID fbdb7686a9e99592f0fea0b7d711b209b376f3ce # Parent ed533d4698382b680421a418a1fc7f26dde8b4c5 tiobjd: raw dump of line number records implemented diff -r ed533d469838 -r fbdb7686a9e9 leo-obj/tool/Makefile --- a/leo-obj/tool/Makefile Mon Apr 28 04:51:35 2014 +0000 +++ b/leo-obj/tool/Makefile Mon Apr 28 05:55:40 2014 +0000 @@ -1,7 +1,7 @@ CC= gcc CFLAGS= -O2 PROG= tiobjd -OBJS= armdis.o atcommon.o basics.o disasm.o globals.o hints.o lowlevel.o \ +OBJS= armdis.o atcommon.o basics.o disasm.o globals.o hints.o ln.o lowlevel.o\ main.o profile.o reloc.o symtab.o tables.o thumbdis.o HDRS= coffconst.h filestruct.h globals.h intstruct.h diff -r ed533d469838 -r fbdb7686a9e9 leo-obj/tool/ln.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/leo-obj/tool/ln.c Mon Apr 28 05:55:40 2014 +0000 @@ -0,0 +1,33 @@ +/* + * Dumping of line number records + */ + +#include +#include +#include +#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); +} diff -r ed533d469838 -r fbdb7686a9e9 leo-obj/tool/main.c --- a/leo-obj/tool/main.c Mon Apr 28 04:51:35 2014 +0000 +++ b/leo-obj/tool/main.c Mon Apr 28 05:55:40 2014 +0000 @@ -11,6 +11,7 @@ extern int cmd_basics(); extern int cmd_disasm(); +extern int cmd_ln(); extern int cmd_nm(); extern int cmd_profile(); extern int cmd_rawrel(); @@ -27,6 +28,7 @@ {"disasm", cmd_disasm}, {"dumpsym", cmd_symtab}, /* backward compat */ {"hdr", dump_filehdr_info}, + {"ln", cmd_ln}, {"nm", cmd_nm}, {"profile", cmd_profile}, {"rawrel", cmd_rawrel},