Skip to content

Commit

Permalink
disas: Replace 'unsigned long' by 'uintptr_t'
Browse files Browse the repository at this point in the history
This is needed for w64. It changes nothing for other hosts.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Apr 15, 2012
1 parent 3ba1925 commit b0b0f1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions disas.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,15 @@ void target_disas(FILE *out, target_ulong code, target_ulong size, int flags)
/* Disassemble this for me please... (debugging). */
void disas(FILE *out, void *code, unsigned long size)
{
unsigned long pc;
uintptr_t pc;
int count;
struct disassemble_info disasm_info;
int (*print_insn)(bfd_vma pc, disassemble_info *info);

INIT_DISASSEMBLE_INFO(disasm_info, out, fprintf);

disasm_info.buffer = code;
disasm_info.buffer_vma = (unsigned long)code;
disasm_info.buffer_vma = (uintptr_t)code;
disasm_info.buffer_length = size;

#ifdef HOST_WORDS_BIGENDIAN
Expand Down Expand Up @@ -320,8 +320,8 @@ void disas(FILE *out, void *code, unsigned long size)
(long) code);
return;
#endif
for (pc = (unsigned long)code; size > 0; pc += count, size -= count) {
fprintf(out, "0x%08lx: ", pc);
for (pc = (uintptr_t)code; size > 0; pc += count, size -= count) {
fprintf(out, "0x%08" PRIxPTR ": ", pc);
count = print_insn(pc, &disasm_info);
fprintf(out, "\n");
if (count < 0)
Expand Down

0 comments on commit b0b0f1c

Please sign in to comment.