outdbg: fix OUT_REL*ADR, add OUT_REL8ADR

The OUT_REL*ADR types pass a pointer which points to an int64_t
which then should be truncated down to size.  This matters on
bigendian platforms.

Add OUT_REL8ADR.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2009-07-07 10:24:52 -07:00
parent 215086ace8
commit 62c0e8379c

View File

@ -157,13 +157,18 @@ static void dbg_out(int32_t segto, const void *data,
segment, wrt);
break;
case OUT_REL2ADR:
fprintf(dbgf, "rel2adr %04x (seg %08"PRIx32")\n", (int)*(int16_t *)data,
segment);
fprintf(dbgf, "rel2adr %04x (seg %08"PRIx32")\n",
(uint16_t)*(int64_t *)data, segment);
break;
case OUT_REL4ADR:
fprintf(dbgf, "rel4adr %08"PRIx32" (seg %08"PRIx32")\n", *(int32_t *)data,
fprintf(dbgf, "rel4adr %08"PRIx32" (seg %08"PRIx32")\n",
(uint32_t)*(int64_t *)data,
segment);
break;
case OUT_REL8ADR:
fprintf(dbgf, "rel8adr %016"PRIx64" (seg %08"PRIx32")\n",
(uint64_t)*(int64_t *)data, segment);
break;
default:
fprintf(dbgf, "unknown\n");
break;