From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id 548693858C53 for ; Fri, 5 Aug 2022 11:21:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 548693858C53 Received: by mail-pg1-x535.google.com with SMTP id s206so2432641pgs.3 for ; Fri, 05 Aug 2022 04:21:45 -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:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0M+Xillq1sgW/MNvAm8NIip6TnUaCnO955s44PQncWA=; b=5OV1faEDnjWlqAlR9kSenB1yc0VAqot8Q1hXG5FpXmyQoflxyYF8tYOCmEWeQxNejX nFT/dTPgyRrYV4tfkMrdaPBEVGXV4TsKVI3Ef/d5YnYku2K2HnhPX9ovGPwALYonZHvM 5IrZAQpaq3l4SkIolkHBP5E7fl5ZZt0jCvcs0L4SJ5q6rsqizbfzRUl8sNNaRkSmK3yb 1Y/kMqya0j8REY1nc3reEVI6bH9oTIFp6VaIPSBmfcJEuDWUEof+0T+UaC6veUxupl0e genbLeW9jKuM7s560kHy6Ut4dqGPOk9dlDZHrGh6tezUFcLHJksIJVJ2Rj3q9sDKLtPj 0M9A== X-Gm-Message-State: ACgBeo1f2PNqMmplCBZ91FWSkjWYK+4sw/hOlB+RHzyCVsP+vwIIvy9P QXrlFXkNSgaFt3rqvufC4gZ83ujXXtg= X-Google-Smtp-Source: AA6agR7uOZjgDnvE/jO7yt3wpvA1650U/lIt3v6M/yba8dCa6y4fpZvrZvnp6yWZEVVp4C9MSVvBhw== X-Received: by 2002:a65:6b8a:0:b0:3fc:4c06:8a8d with SMTP id d10-20020a656b8a000000b003fc4c068a8dmr5341281pgw.83.1659698504107; Fri, 05 Aug 2022 04:21:44 -0700 (PDT) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id gx1-20020a17090b124100b001f32f242020sm2686855pjb.43.2022.08.05.04.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Aug 2022 04:21:43 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 93D4F11412E0; Fri, 5 Aug 2022 20:51:40 +0930 (ACST) Date: Fri, 5 Aug 2022 20:51:40 +0930 From: Alan Modra To: Tom Tromey Cc: Alan Modra via Gdb-patches Subject: Re: Don't use BFD_VMA_FMT in gdb and sim Message-ID: References: <87zggjga9u.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87zggjga9u.fsf@tromey.com> X-Spam-Status: No, score=-3036.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 05 Aug 2022 11:21:49 -0000 On Thu, Aug 04, 2022 at 11:59:25AM -0600, Tom Tromey wrote: > >>>>> "Alan" == Alan Modra via Gdb-patches writes: > > Alan> Like commit b82817674f, this replaces BFD_VMA_FMT "x" with PRIx64, > Alan> and casts to promote bfd_vma to uint64_t. > > Alan> Tested with both 64-bit and 32-bit gdb builds, and 64-bit make check. > Alan> OK to install? > > Alan> diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c > Alan> index 2516e4ed058..c2823191b42 100644 > Alan> --- a/gdb/windows-tdep.c > Alan> +++ b/gdb/windows-tdep.c > Alan> @@ -1011,10 +1011,10 @@ is_linked_with_cygwin_dll (bfd *abfd) > Alan> || import_table_va >= idata_section_end_va) > Alan> { > Alan> warning (_("\ > Alan> -%s: import table's virtual address (0x%" BFD_VMA_FMT "x) is outside .idata \ > Alan> -section's range [0x%" BFD_VMA_FMT "x, 0x%" BFD_VMA_FMT "x[."), > Alan> - bfd_get_filename (abfd), import_table_va, idata_section_va, > Alan> - idata_section_end_va); > Alan> +%s: import table's virtual address (0x%" PRIx64 ") is outside .idata \ > Alan> +section's range [0x%" PRIx64 ", 0x%" PRIx64 "[."), > Alan> + bfd_get_filename (abfd), (uint64_t) import_table_va, > Alan> + (uint64_t) idata_section_va, (uint64_t) idata_section_end_va); > > For gdb, it's more normal to use %s and 'hex_string (value)'. > hex_string will add the 0x as well. It's fine to call it multiple times > in a single printf. OK, here's a revision of the gdb/windows-tdep.c changes. With range bracket fixed too. sim/ remains as before. diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index a34ac5e5f0a..702af65d450 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -1007,10 +1007,11 @@ 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 (%s) is outside .idata \ +section's range [%s, %s]."), + bfd_get_filename (abfd), hex_string (import_table_va), + hex_string (idata_section_va), + hex_string (idata_section_end_va)); return false; } @@ -1057,10 +1058,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 (%s) is outside .idata section's \ +range [%s, %s]."), + bfd_get_filename (abfd), hex_string (name_va), + hex_string (idata_section_va), + hex_string (idata_section_end_va)); break; } -- Alan Modra Australia Development Lab, IBM