From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id vu5HOf1Z62L9ZCAAWB0awg (envelope-from ) for ; Thu, 04 Aug 2022 01:32:45 -0400 Received: by simark.ca (Postfix, from userid 112) id D8ECB1EA05; Thu, 4 Aug 2022 01:32:45 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ED/u3yVx; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id E231F1E9ED for ; Thu, 4 Aug 2022 01:32:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC3C7385700F for ; Thu, 4 Aug 2022 05:32:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC3C7385700F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1659591164; bh=Il97LDqPgz19tTQwDvKLENguhyYfnSlyEO2pnfLCXcs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ED/u3yVxGQCcSi/9buzYoAPbOGIP74D+74gnuCzMj8k/gZ3s2LrxuJ54yF2s5oiJQ vPfx9/xpry5zOgyNizRGvdujeWqItwe5Z7J/zHn1Uul2vaB2seM5CdgbkaG6k+KqqX fc/1jfFvlLe0NDMdT3QPHJUNaweb+7dNCFpIh+wo= Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 07AB7385735A for ; Thu, 4 Aug 2022 05:32:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 07AB7385735A Received: by mail-pj1-x1033.google.com with SMTP id h21-20020a17090aa89500b001f31a61b91dso4174431pjq.4 for ; Wed, 03 Aug 2022 22:32:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=Il97LDqPgz19tTQwDvKLENguhyYfnSlyEO2pnfLCXcs=; b=ZnKTi2Fuqn2pXv5Gjm/uiU04ZztwYo4nLw9Fl4HsOJG99IMowkQSuVvAgGGwY5BpfH EqLPynyJq1ebVgxeUuu/VwsN62VtvUwGwA892IbRJj2VJZVQafh1o1pVbE+/yp5wRYGE Be6JRmaPqUHRiEvK+M7P2EAFbEDyS9nLiIPUoqQ7Ui4LeOkb5fK9hjCCkTZLN+3ZGhPp JGXmwdmeeCZFJdQLPVFMZAkfu3a/VVLls4rufCbEXVqqCETjHKVaOgezJcITrAK3UlQN /pLr0BxHGHmiJITev1ufH9bIEqw+NgFRzNqEJCAMqpul+dSwn16uwjjNwwHrJ4lYu7Io V50A== X-Gm-Message-State: ACgBeo0ZFoMHxJ5TRl+WXq6dbSkC345lYETUjHgFwr2QG2HmpSHpLOAF IQiHDauRrIMijgvZMG0qFF0xgdiRWfs= X-Google-Smtp-Source: AA6agR5WLis8leN9GARNz32TrMbHtRJT9N8D7LD1EH9np4AGPvORrX8ybZDlsrx9dLknZSAcX5iVyQ== X-Received: by 2002:a17:902:ce83:b0:16d:d667:d4df with SMTP id f3-20020a170902ce8300b0016dd667d4dfmr251786plg.159.1659591140561; Wed, 03 Aug 2022 22:32:20 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:ef4:7794:2526:93ad]) by smtp.gmail.com with ESMTPSA id w12-20020a170902e88c00b0016d1bee1519sm3022941plg.102.2022.08.03.22.32.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Aug 2022 22:32:20 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 654B3114005C; Thu, 4 Aug 2022 15:02:17 +0930 (ACST) Date: Thu, 4 Aug 2022 15:02:17 +0930 To: gdb-patches@sourceware.org Subject: Don't use BFD_VMA_FMT in gdb and sim Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Alan Modra via Gdb-patches Reply-To: Alan Modra Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Like commit b82817674f, this replaces BFD_VMA_FMT "x" with PRIx64, and casts to promote bfd_vma to uint64_t. Tested with both 64-bit and 32-bit gdb builds, and 64-bit make check. OK to install? diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index 2516e4ed058..c2823191b42 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -1011,10 +1011,10 @@ is_linked_with_cygwin_dll (bfd *abfd) || import_table_va >= idata_section_end_va) { warning (_("\ -%s: import table's virtual address (0x%" BFD_VMA_FMT "x) is outside .idata \ -section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), - bfd_get_filename (abfd), import_table_va, idata_section_va, - idata_section_end_va); +%s: import table's virtual address (0x%" PRIx64 ") is outside .idata \ +section's range [0x%" PRIx64 ", 0x%" PRIx64 "[."), + bfd_get_filename (abfd), (uint64_t) import_table_va, + (uint64_t) idata_section_va, (uint64_t) idata_section_end_va); return false; } @@ -1061,10 +1061,11 @@ section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), if (name_va < idata_section_va || name_va >= idata_section_end_va) { warning (_("\ -%s: name's virtual address (0x%" BFD_VMA_FMT "x) is outside .idata section's \ -range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), - bfd_get_filename (abfd), name_va, idata_section_va, - idata_section_end_va); +%s: name's virtual address (0x%" PRIx64 ") is outside .idata section's \ +range [0x%" PRIx64 ", 0x%" PRIx64 "[."), + bfd_get_filename (abfd), (uint64_t) name_va, + (uint64_t) idata_section_va, + (uint64_t) idata_section_end_va); break; } diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c index 3df30c55833..e79e93c7b39 100644 --- a/sim/common/cgen-trace.c +++ b/sim/common/cgen-trace.c @@ -366,8 +366,8 @@ sim_disasm_perror_memory (int status, bfd_vma memaddr, /* Actually, address between memaddr and memaddr + len was out of bounds. */ info->fprintf_func (info->stream, - "Address 0x%" BFD_VMA_FMT "x is out of bounds.", - memaddr); + "Address 0x%" PRIx64 " is out of bounds.", + (uint64_t) memaddr); } /* Disassemble using the CGEN opcode table. diff --git a/sim/common/sim-load.c b/sim/common/sim-load.c index 020165a0dce..80fa2ea4f90 100644 --- a/sim/common/sim-load.c +++ b/sim/common/sim-load.c @@ -121,11 +121,10 @@ sim_load_file (SIM_DESC sd, const char *myname, host_callback *callback, if (verbose_p) { xprintf (callback, - "Loading section %s, size 0x%lx %s " - "%" BFD_VMA_FMT "x\n", - bfd_section_name (s), - (unsigned long) size, - (lma_p ? "lma" : "vma"), lma); + "Loading section %s, size 0x%" PRIx64 + " %s %" PRIx64 "\n", + bfd_section_name (s), (uint64_t) size, + lma_p ? "lma" : "vma", (uint64_t) lma); } data_count += size; bfd_get_section_contents (result_bfd, s, buffer, 0, size); @@ -147,8 +146,8 @@ sim_load_file (SIM_DESC sd, const char *myname, host_callback *callback, if (verbose_p) { end_time = time (NULL); - xprintf (callback, "Start address %" BFD_VMA_FMT "x\n", - bfd_get_start_address (result_bfd)); + xprintf (callback, "Start address %" PRIx64 "\n", + (uint64_t) bfd_get_start_address (result_bfd)); report_transfer_performance (callback, data_count, start_time, end_time); } diff --git a/sim/cr16/interp.c b/sim/cr16/interp.c index 47fb64781bf..b375dadff5d 100644 --- a/sim/cr16/interp.c +++ b/sim/cr16/interp.c @@ -677,8 +677,8 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, start_address = 0x0; #ifdef DEBUG if (cr16_debug) - sim_io_printf (sd, "sim_create_inferior: PC=0x%" BFD_VMA_FMT "x\n", - start_address); + sim_io_printf (sd, "sim_create_inferior: PC=0x%" PRIx64 "\n", + (uint64_t) start_address); #endif { SIM_CPU *cpu = STATE_CPU (sd, 0); diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index d7c1005fcac..75176d0c020 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -257,17 +257,18 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write) if (verbose) sim_io_printf (sd, - "Loading segment at 0x%" BFD_VMA_FMT "x, " - "size 0x%" BFD_VMA_FMT "x\n", - lma, phdr[i].p_filesz); + "Loading segment at 0x%" PRIx64 ", " + "size 0x%" PRIx64 "\n", + (uint64_t) lma, (uint64_t) phdr[i].p_filesz); if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0 || (bfd_bread (buf, phdr[i].p_filesz, abfd) != phdr[i].p_filesz)) { sim_io_eprintf (sd, - "%s: could not read segment at 0x%" BFD_VMA_FMT "x, " - "size 0x%" BFD_VMA_FMT "x\n", - STATE_MY_NAME (sd), lma, phdr[i].p_filesz); + "%s: could not read segment at 0x%" PRIx64 ", " + "size 0x%" PRIx64 "\n", + STATE_MY_NAME (sd), (uint64_t) lma, + (uint64_t) phdr[i].p_filesz); free (buf); return FALSE; } @@ -275,9 +276,10 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write) if (do_write (sd, lma, buf, phdr[i].p_filesz) != phdr[i].p_filesz) { sim_io_eprintf (sd, - "%s: could not load segment at 0x%" BFD_VMA_FMT "x, " - "size 0x%" BFD_VMA_FMT "x\n", - STATE_MY_NAME (sd), lma, phdr[i].p_filesz); + "%s: could not load segment at 0x%" PRIx64 ", " + "size 0x%" PRIx64 "\n", + STATE_MY_NAME (sd), (uint64_t) lma, + (uint64_t) phdr[i].p_filesz); free (buf); return FALSE; } @@ -573,9 +575,8 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd) memory area, so we go via a temporary area. Luckily, the interpreter is supposed to be small, less than 0x40000 bytes. */ - sim_do_commandf (sd, "memory region 0x%" BFD_VMA_FMT "x," - "0x%" BFD_VMA_FMT "x", - interp_load_addr, interpsiz); + sim_do_commandf (sd, "memory region 0x%" PRIx64 ",0x%" PRIx64, + (uint64_t) interp_load_addr, (uint64_t) interpsiz); /* Now that memory for the interpreter is defined, load it. */ if (!cris_load_elf_file (sd, ibfd, cris_write_interp)) diff --git a/sim/d10v/interp.c b/sim/d10v/interp.c index 5716a10583e..fde96aa70e3 100644 --- a/sim/d10v/interp.c +++ b/sim/d10v/interp.c @@ -1171,8 +1171,8 @@ sim_create_inferior (SIM_DESC sd, struct bfd *abfd, start_address = 0xffc0 << 2; #ifdef DEBUG if (d10v_debug) - sim_io_printf (sd, "sim_create_inferior: PC=0x%" BFD_VMA_FMT "x\n", - start_address); + sim_io_printf (sd, "sim_create_inferior: PC=0x%" PRIx64 "\n", + (uint64_t) start_address); #endif { SIM_CPU *cpu = STATE_CPU (sd, 0); diff --git a/sim/erc32/func.c b/sim/erc32/func.c index b4f2b420e34..4d1942065b8 100644 --- a/sim/erc32/func.c +++ b/sim/erc32/func.c @@ -1060,8 +1060,8 @@ bfd_load (const char *fname) section_size = bfd_section_size (section); if (sis_verbose) - printf("\nsection %s at 0x%08" BFD_VMA_FMT "x (0x%lx bytes)", - section_name, section_address, section_size); + printf("\nsection %s at 0x%08" PRIx64 " (0x%lx bytes)", + section_name, (uint64_t) section_address, section_size); /* Text, data or lit */ if (bfd_section_flags (section) & SEC_LOAD) { diff --git a/sim/m32c/load.c b/sim/m32c/load.c index ce0bddc82d1..9a432d0bf4b 100644 --- a/sim/m32c/load.c +++ b/sim/m32c/load.c @@ -99,8 +99,8 @@ m32c_load (bfd * prog) base = bfd_section_lma (s); if (verbose) - fprintf (stderr, "[load a=%08" BFD_VMA_FMT "x s=%08x %s]\n", - base, (int) size, bfd_section_name (s)); + fprintf (stderr, "[load a=%08" PRIx64 " s=%08x %s]\n", + (uint64_t) base, (int) size, bfd_section_name (s)); buf = (char *) malloc (size); bfd_get_section_contents (prog, s, buf, 0, size); mem_put_blk (base, buf, size); diff --git a/sim/rl78/load.c b/sim/rl78/load.c index 2bf5469a62a..5c99f2278a1 100644 --- a/sim/rl78/load.c +++ b/sim/rl78/load.c @@ -130,15 +130,15 @@ rl78_load (bfd *prog, host_callback *callbacks, const char * const simname) base = p->p_paddr; if (verbose > 1) fprintf (stderr, - "[load segment: lma=%08" BFD_VMA_FMT "x vma=%08x " - "size=%08" BFD_VMA_FMT "x]\n", - base, (int) p->p_vaddr, size); + "[load segment: lma=%08" PRIx64 " vma=%08" PRIx64 " " + "size=%08" PRIx64 "]\n", + (uint64_t) base, (uint64_t) p->p_vaddr, (uint64_t) size); if (callbacks) xprintf (callbacks, - "Loading section %s, size %#" BFD_VMA_FMT "x " - "lma %08" BFD_VMA_FMT "x vma %08lx\n", + "Loading section %s, size %#" PRIx64 " " + "lma %08" PRIx64 " vma %08" PRIx64 "\n", find_section_name_by_offset (prog, p->p_offset), - size, base, p->p_vaddr); + (uint64_t) size, (uint64_t) base, (uint64_t) p->p_vaddr); buf = xmalloc (size); @@ -151,17 +151,17 @@ rl78_load (bfd *prog, host_callback *callbacks, const char * const simname) if (bfd_bread (buf, size, prog) != size) { - fprintf (stderr, "%s: Failed to read %" BFD_VMA_FMT "x bytes\n", - simname, size); + fprintf (stderr, "%s: Failed to read %" PRIx64 " bytes\n", + simname, (uint64_t) size); continue; } if (base > 0xeffff || base + size > 0xeffff) { fprintf (stderr, - "%s, Can't load image to RAM/SFR space: 0x%" BFD_VMA_FMT "x " - "- 0x%" BFD_VMA_FMT "x\n", - simname, base, base+size); + "%s, Can't load image to RAM/SFR space: 0x%" PRIx64 " " + "- 0x%" PRIx64 "\n", + simname, (uint64_t) base, (uint64_t) (base + size)); continue; } if (max_rom < base + size) diff --git a/sim/rx/load.c b/sim/rx/load.c index 500babc0d7d..a0dca3d5b25 100644 --- a/sim/rx/load.c +++ b/sim/rx/load.c @@ -130,14 +130,15 @@ rx_load (bfd *prog, host_callback *callback) base = p->p_paddr; if (verbose > 1) fprintf (stderr, - "[load segment: lma=%08" BFD_VMA_FMT "x vma=%08x " - "size=%08" BFD_VMA_FMT "x]\n", - base, (int) p->p_vaddr, size); + "[load segment: lma=%08" PRIx64 " vma=%08" PRIx64 " " + "size=%08" PRIx64 "]\n", + (uint64_t) base, (uint64_t) p->p_vaddr, (uint64_t) size); if (callback) xprintf (callback, - "Loading section %s, size %#lx lma %08lx vma %08lx\n", + "Loading section %s, size %#" PRIx64 " lma %08" PRIx64 + " vma %08" PRIx64 "\n", find_section_name_by_offset (prog, p->p_offset), - size, base, p->p_vaddr); + (uint64_t) size, (uint64_t) base, (uint64_t) p->p_vaddr); buf = malloc (size); if (buf == NULL) @@ -154,7 +155,8 @@ rx_load (bfd *prog, host_callback *callback) } if (bfd_bread (buf, size, prog) != size) { - fprintf (stderr, "Failed to read %" BFD_VMA_FMT "x bytes\n", size); + fprintf (stderr, "Failed to read %" PRIx64 " bytes\n", + (uint64_t) size); continue; } -- Alan Modra Australia Development Lab, IBM