diff options
Diffstat (limited to 'binutils/prdbg.c')
-rw-r--r-- | binutils/prdbg.c | 39 |
1 files changed, 5 insertions, 34 deletions
diff --git a/binutils/prdbg.c b/binutils/prdbg.c index d6cbab8..c1e4162 100644 --- a/binutils/prdbg.c +++ b/binutils/prdbg.c @@ -485,41 +485,12 @@ pop_type (struct pr_handle *info) static void print_vma (bfd_vma vma, char *buf, bool unsignedp, bool hexp) { - if (sizeof (vma) <= sizeof (unsigned long)) - { - if (hexp) - sprintf (buf, "0x%lx", (unsigned long) vma); - else if (unsignedp) - sprintf (buf, "%lu", (unsigned long) vma); - else - sprintf (buf, "%ld", (long) vma); - } -#if BFD_HOST_64BIT_LONG_LONG - else if (sizeof (vma) <= sizeof (unsigned long long)) - { -#ifndef __MSVCRT__ - if (hexp) - sprintf (buf, "0x%llx", (unsigned long long) vma); - else if (unsignedp) - sprintf (buf, "%llu", (unsigned long long) vma); - else - sprintf (buf, "%lld", (long long) vma); -#else - if (hexp) - sprintf (buf, "0x%I64x", (unsigned long long) vma); - else if (unsignedp) - sprintf (buf, "%I64u", (unsigned long long) vma); - else - sprintf (buf, "%I64d", (long long) vma); -#endif - } -#endif + if (hexp) + sprintf (buf, "%#" PRIx64, (uint64_t) vma); + else if (unsignedp) + sprintf (buf, "%" PRIu64, (uint64_t) vma); else - { - buf[0] = '0'; - buf[1] = 'x'; - sprintf_vma (buf + 2, vma); - } + sprintf (buf, "%" PRId64, (int64_t) vma); } /* Start a new compilation unit. */ |