From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88417 invoked by alias); 17 Feb 2017 12:31:28 -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 88400 invoked by uid 89); 17 Feb 2017 12:31:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:882, H*f:sk:s-POacR, H*MI:sk:39A5493, H*f:sk:39A5493 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Feb 2017 12:31:26 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 698E8624CD; Fri, 17 Feb 2017 12:31:26 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1HCVNWf008008; Fri, 17 Feb 2017 07:31:23 -0500 Subject: Re: [PATCH 2/5] arc: Set section to ".text" when disassembling To: Anton Kolesov , Yao Qi References: <20170214100130.29194-1-Anton.Kolesov@synopsys.com> <20170214100130.29194-2-Anton.Kolesov@synopsys.com> <39A54937CC95F24AA2F794E2D2B66B1358249A97@DE02WEMBXB.internal.synopsys.com> Cc: "gdb-patches@sourceware.org" , Francois Bedard From: Pedro Alves Message-ID: Date: Fri, 17 Feb 2017 12:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <39A54937CC95F24AA2F794E2D2B66B1358249A97@DE02WEMBXB.internal.synopsys.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-02/txt/msg00474.txt.bz2 On 02/16/2017 04:35 PM, Anton Kolesov wrote: > Hi Yao, > >> info->section should be valid, but why must it be ".text"? Can I >> info->disassembly >> instructions in .plt section? How about using find_pc_section (addr) to get >> the right section? like mep_gdb_print_insn. > > Actual section doesn't matter here because opcodes really need elf header, which is > just obtained through a section. I've used .text simply because it is the section that is > very likely to exist. Using find_pc_section seems to be a much better solution, I wasn't > aware of it. Will change this in second version of the patch. And even better approach would be to include the right arch in the xml target description, in the (existing) element, and then somehow pass that info down to opcodes here... Thanks, Pedro Alves