From 6ada20f685fcf4d46dfd2e376d5dd91aa7ead93e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 7 Mar 2020 02:06:33 +0900 Subject: [PATCH] [qfcc] Show offset for op_x_def_ofs relocs --- tools/qfcc/source/dump_globals.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/qfcc/source/dump_globals.c b/tools/qfcc/source/dump_globals.c index 657f016e8..157635f63 100644 --- a/tools/qfcc/source/dump_globals.c +++ b/tools/qfcc/source/dump_globals.c @@ -337,6 +337,8 @@ qfo_relocs (qfo_t *qfo) qfo_reloc_t *reloc; qfo_def_t *def; qfo_func_t *func; + int opind; + dstatement_t *statement; unsigned i; for (i = 0; i < qfo->num_relocs; i++) { @@ -399,10 +401,13 @@ qfo_relocs (qfo_t *qfo) case rel_op_b_def_ofs: case rel_op_c_def_ofs: def = qfo->defs + reloc->target; - printf (" op.%c@%x def#%d %s", - reloc->type - rel_op_a_def_ofs + 'a', + opind = reloc->type - rel_op_a_def_ofs; + statement = QFO_STATEMENT (qfo, reloc->offset); + printf (" op.%c@%x def#%d %s+%d", + opind + 'a', reloc->offset, reloc->target, - QFO_GETSTR (qfo, def->name)); + QFO_GETSTR (qfo, def->name), + ((pr_ushort_t *)statement)[opind + 1]); break; case rel_def_def_ofs: def = qfo->defs + reloc->target;