From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118798 invoked by alias); 3 Aug 2017 12:25:00 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 113934 invoked by uid 89); 3 Aug 2017 12:24:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=979, online X-Spam-User: qpsmtpd, 2 recipients X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Aug 2017 12:24:26 +0000 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 21C3DB1ECEA30; Thu, 3 Aug 2017 13:24:21 +0100 (IST) Received: from [10.20.78.17] (10.20.78.17) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.294.0; Thu, 3 Aug 2017 13:24:23 +0100 Date: Thu, 03 Aug 2017 12:25:00 -0000 From: "Maciej W. Rozycki" To: Yao Qi CC: , , Alan Modra Subject: Re: [PATCH] GDB/opcodes: Remove arch/mach/endian disassembler assertions In-Reply-To: Message-ID: References: <86pocc3oam.fsf@gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2017-08/txt/msg00058.txt.bz2 On Thu, 3 Aug 2017, Maciej W. Rozycki wrote: > > I prefer to keep these asserts, as they could check the inconsistent > > uses of disassemble_info between gdb and opcodes. There is another > > assert for target armv5te, PR 21818, but the assert exposes an improper > > or unexpected usage of disassemble_info.mach in opcodes/arm-dis.c. I am > > fixing it. > > How does the retaining of these assertions interact with `set > architecture' and `set endian' then? E.g.: $ x86_64-linux-gnu-gdb GNU gdb (GDB) 8.0.50.20170729-git Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word". (gdb) file main86 Reading symbols from main86...(no debugging symbols found)...done. (gdb) show architecture The target architecture is set automatically (currently i386:x86-64) (gdb) disassemble main Dump of assembler code for function main: 0x0000000000400450 <+0>: xor %eax,%eax 0x0000000000400452 <+2>: retq End of assembler dump. (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) disassemble main Dump of assembler code for function main: 0x00400450 <+0>: .../gdb/arch-utils.c:979: internal-error: int default_print_insn(bfd_vma, disassemble_info*): Assertion `info->mach == bfd_get_mach (exec_bfd)' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) n This is a bug, please report it. For instructions, see: . .../gdb/arch-utils.c:979: internal-error: int default_print_insn(bfd_vma, disassemble_info*): Assertion `info->mach == bfd_get_mach (exec_bfd)' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) n Command aborted. (gdb) A change applied to the MIPS backend obviously won't do anything here. Maciej