From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74865 invoked by alias); 12 Oct 2016 08:08:20 -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 74834 invoked by uid 89); 12 Oct 2016 08:08:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_IN_SEMBACKSCATTER,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:2078 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Oct 2016 08:08:09 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u9C83VRj118758 for ; Wed, 12 Oct 2016 04:08:08 -0400 Received: from e06smtp15.uk.ibm.com (e06smtp15.uk.ibm.com [195.75.94.111]) by mx0a-001b2d01.pphosted.com with ESMTP id 261h428yh2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 12 Oct 2016 04:08:07 -0400 Received: from localhost by e06smtp15.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Oct 2016 09:08:05 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp15.uk.ibm.com (192.168.101.145) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 12 Oct 2016 09:08:04 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 882B5219004D; Wed, 12 Oct 2016 09:07:21 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u9C884hd23199776; Wed, 12 Oct 2016 08:08:04 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u9C883Se012793; Wed, 12 Oct 2016 02:08:03 -0600 Received: from oc8523832656.ibm.com (icon-9-164-182-54.megacenter.de.ibm.com [9.164.182.54]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u9C88315012769; Wed, 12 Oct 2016 02:08:03 -0600 Received: by oc8523832656.ibm.com (Postfix, from userid 500) id C867010FDC3; Wed, 12 Oct 2016 10:08:01 +0200 (CEST) Subject: Re: [PATCH, RFC] Add support for choosing disassembler cpu in GDB for POWER. To: bergner@vnet.ibm.com (Peter Bergner) Date: Wed, 12 Oct 2016 08:08:00 -0000 From: "Ulrich Weigand" Cc: palves@redhat.com (Pedro Alves), amodra@gmail.com (Alan Modra), gdb-patches@sourceware.org, binutils@sourceware.org (binutils) In-Reply-To: <25537872-c66e-f92d-aa28-cedb9df0f1a6@vnet.ibm.com> from "Peter Bergner" at Oct 10, 2016 06:28:14 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16101208-0020-0000-0000-0000025F24A7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16101208-0021-0000-0000-00003E8C5493 Message-Id: <20161012080801.C867010FDC3@oc8523832656.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-10-12_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1610120132 X-SW-Source: 2016-10/txt/msg00288.txt.bz2 Peter Bergner wrote: > On 10/7/16 2:21 PM, Ulrich Weigand wrote: > > There's a second use of disassemble_init_for_target, which probably needs > > the same treatment. In fact, maybe the nicest way would be to call the > > callback "gdbarch_disassemble_init_for_target", with a default of simply > > disassemble_init_for_target, but which targets can override to do extra > > stuff before (or after) calling disassemble_init_for_target in there. > > GDB common code would then just call gdbarch_disassemble_init_for_target > > everywhere it currently calls disassemble_init_for_target. > > Ok, I think this resolves all of your last suggestions. Is this better? > > Peter > > > > include/ > * dis-asm.h (ppc_verify_disassembler_options): New prototype. > > opcodes/ > * ppc-dis.c (parse_ppc_dis_option): New function. > (ppc_verify_disassembler_options): Likewise. > (powerpc_init_dialect): Use parse_ppc_dis_option(). > > gdb/ > * gdbarch.sh (gdbarch_disassemble_init_for_target): New function. > * gdbarch.c: Regenerate. > * gdbarch.h: Likewise. > * disasm.c (gdb_disassemble_info): Use it. > (gdb_buffered_insn_length_init_dis): Likewise. > * rs6000-tdep.c: (gdb_disassembler_cpu): New static declaration. > (prospective_cpu): Likewise. > (gdb_disassemble_init_for_ppc): New function. > (set_disassembler_cpu): Likewise. > (show_disassembler_cpu): Likewise. > (rs6000_gdbarch_init): Setup callback for gdb_disassemble_init_for_ppc. > (_initialize_rs6000_tdep): Setup callbacks for set_disassembler_cpu() > and show_disassembler_cpu(). > * arch-utils.c: Include "dis-asm.h". > (default_disassemble_init_for_target): New function. > * arch-utils.h (default_disassemble_init_for_target): New Prototype. Yes, for a PowerPC-only solution this patch looks fine to me. Thanks! However, we should resolve the separate discussion with Pedro about maybe getting a fully platform-independent solution first ... Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com