From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58825 invoked by alias); 30 Jun 2017 07:38:57 -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 57467 invoked by uid 89); 30 Jun 2017 07:38:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:1376, HTo:U*macro, H*r:sk:static. X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-io0-f196.google.com Received: from mail-io0-f196.google.com (HELO mail-io0-f196.google.com) (209.85.223.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Jun 2017 07:38:55 +0000 Received: by mail-io0-f196.google.com with SMTP id h134so2845790iof.3; Fri, 30 Jun 2017 00:38:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=sKCQCiJmykeL+47g43a5KrnyUOaKrCpG+d9QlCPt4F0=; b=jBONh25LFDAvBSABmhQ7j1/6rQky1aj4TLbs3d7ntkI5ZYuH3ub0z4eq7dfQxuRvxG eA2U0ZlAn7+T/Bv79cfvmtVtxCC/0Gqr5tzhHuE5XxtyN9LB33uYv9Ww1IgGZzJTjzDO VmzYZKkjzrlRb6ZBCgfLwYW+QtJ6IxxJTD/m+KXDIaJsOUCbxTVXYx9bngRD00Thoq5Z b7F8ufTPqxgDugKgv02EinuKTsYbqGCrz0JQW0cwu+Q6mPwX/4hdQsx0DEyF2BFG/sKt MZVsZ8fHJdJo/yS6/sk+/rsHoGwa5ni21UWruv2OK/OolzCiDZ4kZBDU/RdLMCYj0Kah X3NA== X-Gm-Message-State: AKS2vOw70tOzddx6qSXZFITwyT/nv9E5T4PMlUazEExQIwN10kzwaM9m STyscrtX5rSKzqDI X-Received: by 10.107.197.66 with SMTP id v63mr21138644iof.219.1498808333440; Fri, 30 Jun 2017 00:38:53 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id b202sm3831871iof.60.2017.06.30.00.38.52 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 30 Jun 2017 00:38:53 -0700 (PDT) From: Yao Qi To: "Maciej W. Rozycki" Cc: , Subject: Re: [PATCH 2/6] Delegate opcodes to select disassembler in GDB References: <1494931698-15309-1-git-send-email-yao.qi@linaro.org> <1494931698-15309-3-git-send-email-yao.qi@linaro.org> Date: Fri, 30 Jun 2017 07:38:00 -0000 In-Reply-To: (Maciej W. Rozycki's message of "Fri, 30 Jun 2017 01:18:50 +0100") Message-ID: <86efu1diwp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00816.txt.bz2 "Maciej W. Rozycki" writes: > This change causes an assertion failure when trying to disassemble a=20 > MIPS16 function: > > (gdb) disassemble main > Dump of assembler code for function main: > 0x00400209 <+0>: > .../gdb/arch-utils.c:979: internal-error: int default_print_insn(bfd_vma,= disassemble_info*): Assertion `info->mach =3D=3D 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) Sorry about that. I did deliberately run testsuite/gdb.base/all-architectures-[0-7].exp tests to cover the case that using disassembler for each architecture. It covers mips, but it doesn't cover mips16 and micromips. > > This is because `info->mach' is 16 (the `bfd_mach_mips16' aka `mips:16'=20 > BFD) whereas `bfd_get_mach (exec_bfd)' is 33 (the `bfd_mach_mipsisa32r2'= =20 > aka `mips:isa32r2' BFD). This is expected for MIPS16 code within a=20 > program that has been built for the MIPS32r2 ISA; see=20 > `gdb_print_insn_mips' for the origin. > > So what's the purpose of this assertion? The assertion is based on assumption that "info->mach" is got from bfd_get_mach (exec_bfd), but it is not right for mips16. We can remove this line. If you agree, I'll post a patch to remove this line. --=20 Yao (=E9=BD=90=E5=B0=A7)