From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 899A73854572; Mon, 28 Nov 2022 19:24:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 899A73854572 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669663468; bh=6d+jpK4kOxwCwy6Mb7lKQsQtrPoI3brMXTe88kZdmsE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rJ166xe/fAYatJpIzwSkZmH4yTtmegnnCdOD3fJy9pd235nVTMW77rZlk3+sSa1AQ v14T8aMNjRqvqGaqqt736DcxwgSEYO2VtBOitdlcO7KJNsQvgKX//baZJ+iHbBhKv3 Wkpd8wHw50uWm8cxrO64TMCNzZ2VSo1GHDTstvt0= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug python/29712] [gdb, aarch64] UNRESOLVED: gdb.python/py-disasm.exp: global_disassembler=ReadMemoryGdbErrorDisassembler: disassemble test Date: Mon, 28 Nov 2022 19:24:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 13.1 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29712 --- Comment #12 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Andrew Burgess : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D8eb7d135e32a= d6b7cdcfeffe486b195058206cdb commit 8eb7d135e32ad6b7cdcfeffe486b195058206cdb Author: Andrew Burgess Date: Mon Oct 24 18:35:41 2022 +0100 gdb/disasm: mark functions passed to the disassembler noexcept While working on another patch, Simon pointed out that GDB could be improved by marking the functions passed to the disassembler as noexcept. https://sourceware.org/pipermail/gdb-patches/2022-October/193084.html The reason this is important is the on some hosts, libopcodes, being C code, will not be compiled with support for handling exceptions. As such, an attempt to throw an exception over libopcodes code will cause GDB to terminate. See bug gdb/29712 for an example of when this happened. In this commit all the functions that are passed to the disassembler, and which might be used as callbacks by libopcodes are marked noexcept. Ideally, I would have liked to change these typedefs: using read_memory_ftype =3D decltype (disassemble_info::read_memory_f= unc); using memory_error_ftype =3D decltype (disassemble_info::memory_error_func); using print_address_ftype =3D decltype (disassemble_info::print_address_func); using fprintf_ftype =3D decltype (disassemble_info::fprintf_func); using fprintf_styled_ftype =3D decltype (disassemble_info::fprintf_styled_func); which are declared in disasm.h, as including the noexcept keyword. However, when I tried this, I ran into this warning/error: In file included from ../../src/gdb/disasm.c:25: ../../src/gdb/disasm.h: In constructor =C3=A2gdb_printing_disassembler::gdb_printing_disassembler(gdbarch*, ui_fil= e*, gdb_disassemble_info::read_memory_ftype, gdb_disassemble_info::memory_error_ftype, gdb_disassemble_info::print_address_ftype)=C3=A2: ../../src/gdb/disasm.h:116:3: error: mangled name for =C3=A2gdb_printing_disassembler::gdb_printing_disassembler(gdbarch*, ui_fil= e*, gdb_disassemble_info::read_memory_ftype, gdb_disassemble_info::memory_error_ftype, gdb_disassemble_info::print_address_ftype)=C3=A2 will change in C++17 becau= se the exception specification is part of a function type [-Werror=3Dnoexcept-type] 116 | gdb_printing_disassembler (struct gdbarch *gdbarch, | ^~~~~~~~~~~~~~~~~~~~~~~~~ So I've left that change out. This does mean that if somebody adds a new use of the disassembler classes in the future, and forgets to mark the callbacks as noexcept, this will compile fine. We'll just have to manually check for that during review. --=20 You are receiving this mail because: You are on the CC list for the bug.=