changeset 151:6fe08feee018

tiobjd disasm -g: line break after function locals
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 01 May 2014 00:23:18 +0000
parents df01a4f4c272
children fcf1ef773a57
files leo-obj/tool/disasm.c leo-obj/tool/richsym.c
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/leo-obj/tool/disasm.c	Tue Apr 29 07:51:28 2014 +0000
+++ b/leo-obj/tool/disasm.c	Thu May 01 00:23:18 2014 +0000
@@ -98,7 +98,8 @@
 	if (sym->class == C_FCN && !strcmp(sym->name, ".bf")) {
 		printf("; Begin function\n");
 		if (disasm_richsym)
-			richsym_function_locals(sym);
+			if (richsym_function_locals(sym))
+				putchar('\n');
 		return;
 	}
 	switch (sym->class) {
--- a/leo-obj/tool/richsym.c	Tue Apr 29 07:51:28 2014 +0000
+++ b/leo-obj/tool/richsym.c	Thu May 01 00:23:18 2014 +0000
@@ -426,11 +426,10 @@
 	return(0);
 }
 
-void
 richsym_function_locals(headsym)
 	struct internal_syment *headsym;
 {
-	unsigned n;
+	unsigned n, count = 0;
 	struct internal_syment *sym;
 	char classbuf[8];
 
@@ -441,6 +440,7 @@
 		switch (sym->class) {
 		case C_REG:
 		case C_REGPARM:
+			count++;
 			if (localsym_sanity_check(sym) < 0)
 				continue;
 			if (sym->value > 0xF) {
@@ -457,6 +457,7 @@
 			continue;
 		case C_ARG:
 		case C_AUTO:
+			count++;
 			if (localsym_sanity_check(sym) < 0)
 				continue;
 			printf("; %s at 0x%x: ",
@@ -465,13 +466,15 @@
 			richsym_print_in_c("", sym, 0);
 			continue;
 		case C_FCN:
-			return;
+			return(count);
 		default:
+			count++;
 			printf(
 			"; presumed local symbol #%u: unexpected class %s\n",
 				sym->number,
 				storage_class_to_string(sym->class, classbuf));
-			return;
+			return(count);
 		}
 	}
+	return(count);
 }