# HG changeset patch # User Michael Spacefalcon # Date 1399074104 0 # Node ID 15743b40e03af885f3b734fefbf104f097ced805 # Parent 1cd11badf28777f432fc7768db656c2b96020cd4 tiobjd ctypes: print more useful hex byte offsets for struct fields diff -r 1cd11badf287 -r 15743b40e03a leo-obj/frame_na7_db_fl/Makefile --- a/leo-obj/frame_na7_db_fl/Makefile Fri May 02 06:20:26 2014 +0000 +++ b/leo-obj/frame_na7_db_fl/Makefile Fri May 02 23:41:44 2014 +0000 @@ -13,7 +13,7 @@ ${TOOL} $*.obj disasm -gl > $@ %.ctypes: %.obj - ${TOOL} $*.obj ctypes > $@ + ${TOOL} $*.obj ctypes -o > $@ ${TARGETS}: ${TOOL} Makefile diff -r 1cd11badf287 -r 15743b40e03a leo-obj/tool/richsym.c --- a/leo-obj/tool/richsym.c Fri May 02 06:20:26 2014 +0000 +++ b/leo-obj/tool/richsym.c Fri May 02 23:41:44 2014 +0000 @@ -323,12 +323,16 @@ int c; unsigned n; struct internal_syment *sym; + int print_offsets = 0; - while ((c = getopt(argc, argv, "b")) != EOF) + while ((c = getopt(argc, argv, "bo")) != EOF) switch (c) { case 'b': richsym_print_bitsize++; continue; + case 'o': + print_offsets++; + continue; default: /* error msg already printed */ exit(1); @@ -386,7 +390,10 @@ case C_MOU: if (sym->scnum != -1) printf("\t/* MOS/MOU section != ABS! */\n"); - else if (richsym_print_bitsize >= 2) + else if (print_offsets && !(sym->value & 7)) + printf("\t/* offset: 0x%x */\n", + sym->value >> 3); + else if (print_offsets || richsym_print_bitsize >= 2) printf("\t/* offset: %u bits */\n", sym->value); richsym_print_in_c("\t", sym, 0); continue;