From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id B52E73858C2B; Mon, 30 Jan 2023 21:15:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B52E73858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675113324; bh=ZIEfn/Eo+rNQcptkQNvCt7yQpSYLxJur2id0R0mbm0I=; h=From:To:Subject:Date:From; b=UZA6T/aDBdV63NSBSKQDD1Gyu028YQfAHkaGx5q0PxHZX5iEkj8jh1u1V6VsGWwP6 ZaG4uLnVGvoW7rcAT/id40LLGWHf8U0uwQcBlA4lxRhQHHXxhLgm/4wFIKk657ZBFZ cP2hE73/8VTfjNBTiTDbsZnyVOm+grVYRPEmxZYc= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: fix dwarf2/cooked-index.c compilation on 32-bit systems X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 214d883794db819617ee60806e3dbeb3d5dab666 X-Git-Newrev: 902d61e3285aa88e635195a0f77541c44d1dfb2c Message-Id: <20230130211524.B52E73858C2B@sourceware.org> Date: Mon, 30 Jan 2023 21:15:24 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D902d61e3285a= a88e635195a0f77541c44d1dfb2c commit 902d61e3285aa88e635195a0f77541c44d1dfb2c Author: Simon Marchi Date: Mon Jan 30 15:46:15 2023 -0500 gdb: fix dwarf2/cooked-index.c compilation on 32-bit systems =20 The i386 builder shows: =20 ../../binutils-gdb/gdb/dwarf2/cooked-index.c: In member function = =E2=80=98void cooked_index_vector::dump(gdbarch*) const=E2=80=99: ../../binutils-gdb/gdb/dwarf2/cooked-index.c:492:40: error: format = =E2=80=98%lx=E2=80=99 expects argument of type =E2=80=98long unsigned int= =E2=80=99, but argument 2 has type =E2=80=98std::__underlying_type_impl::type=E2=80=99 {aka =E2=80=98long long unsigned int=E2=80= =99} [-Werror=3Dformat=3D] 492 | gdb_printf (" DIE offset: 0x%lx\n", | ~~^ | | | long unsigned int | %llx 493 | to_underlying (entry->die_offset)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | std::__underlying_type_impl::type {aka long long unsigned int} =20 The die_offset's underlying type is uint64, so use PRIx64 in the format string. =20 Change-Id: Ibdde4c624ed1bb50eced9a514a4e37aec70a1323 Diff: --- gdb/dwarf2/cooked-index.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index 9dbb844cade..82dc44dd74b 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -489,7 +489,7 @@ cooked_index_vector::dump (gdbarch *arch) const gdb_printf (" canonical: %s\n", entry->canonical); gdb_printf (" DWARF tag: %s\n", dwarf_tag_name (entry->tag)); gdb_printf (" flags: %s\n", to_string (entry->flags).c_str (= )); - gdb_printf (" DIE offset: 0x%lx\n", + gdb_printf (" DIE offset: 0x%" PRIx64 "\n", to_underlying (entry->die_offset)); =20 if (entry->parent_entry !=3D nullptr)