From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71065 invoked by alias); 24 Feb 2017 17:13:37 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 70923 invoked by uid 89); 24 Feb 2017 17:13:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=unavailable version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Feb 2017 17:13:35 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1OH6F4r118671 for ; Fri, 24 Feb 2017 12:13:34 -0500 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 28tp2vgdkm-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Feb 2017 12:13:34 -0500 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 10:13:31 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e35.co.us.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 10:13:30 -0700 Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 30A3619D8042; Fri, 24 Feb 2017 10:12:41 -0700 (MST) Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1OHDTkw17039734; Fri, 24 Feb 2017 10:13:29 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 54BD66E048; Fri, 24 Feb 2017 10:13:29 -0700 (MST) Received: from otta.local (unknown [9.85.168.217]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 5969A6E045; Fri, 24 Feb 2017 10:13:28 -0700 (MST) Subject: Re: [PATCH, v17] Add support for setting disassembler-options in GDB for POWER, ARM and S390 To: Pedro Alves References: <3b6b8153-cfff-8fb3-2cc0-2612f3d2d710@redhat.com> <98f0a8a0-ed6d-10b6-08be-2dd86cc7af44@vnet.ibm.com> <46d6c25a-3d33-8e2a-043a-b46ae004d8b3@redhat.com> Cc: gdb-patches@sourceware.org, Yao Qi , Alan Modra , Ulrich Weigand , binutils From: Peter Bergner Date: Fri, 24 Feb 2017 17:13:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <46d6c25a-3d33-8e2a-043a-b46ae004d8b3@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022417-0012-0000-0000-000013C3DA49 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006675; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000204; SDB=6.00826536; UDB=6.00404825; IPR=6.00603988; BA=6.00005171; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00014427; XFM=3.00000011; UTC=2017-02-24 17:13:31 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022417-0013-0000-0000-00004BB81A65 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-02-24_11:,, 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-1612050000 definitions=main-1702240166 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00342.txt.bz2 On 2/24/17 9:06 AM, Pedro Alves wrote: > On 02/24/2017 04:58 AM, Peter Bergner wrote: >> The only architecture that uses this is the ppc arch and this mimics >> what print_ppc_disassembler_options() does. We have ~60 options that >> we're emitting, so I think wrapping does make things more readable. > > I see. Well that uses 66 instead of 80, which is equally arbitrary.... Well that uses 66 without the length of the option we're printing, while this code includes the length of the option we're printing, so it can be more accurate. But... > What you may want to do is call wrap_here between printing each option, > so that gdb automatically knows to break the line between options > if necessary, instead of in the middle of some option. I didn't realize that fprintf_filtered could wrap the output itself. It does simplify things, so how about using the following loop to print out the options (for arches without descriptions) instead? I can confirm the output wraps nicely. Peter if (valid_options->description != NULL) { ... } else { size_t i; fprintf_filtered (file, " "); for (i = 0; valid_options->name[i] != NULL; i++) { fprintf_filtered (file, "%s", valid_options->name[i]); if (valid_options->name[i+1] != NULL) fprintf_filtered (file, ", "); wrap_here (" "); } fprintf_filtered (file, "\n"); }