From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9014 invoked by alias); 16 Mar 2011 17:45:54 -0000 Received: (qmail 9005 invoked by uid 22791); 16 Mar 2011 17:45:53 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate6.uk.ibm.com (HELO mtagate6.uk.ibm.com) (194.196.100.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Mar 2011 17:45:48 +0000 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate6.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p2GHjjL8020476 for ; Wed, 16 Mar 2011 17:45:45 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p2GHk6FZ1921268 for ; Wed, 16 Mar 2011 17:46:06 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2GHjjW1032065 for ; Wed, 16 Mar 2011 11:45:45 -0600 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p2GHjiV1032056; Wed, 16 Mar 2011 11:45:44 -0600 Message-Id: <201103161745.p2GHjiV1032056@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 16 Mar 2011 18:45:43 +0100 Subject: Re: [RFA] Implement support for PowerPC BookE ranged breakpoints To: bauerman@br.ibm.com (Thiago Jung Bauermann) Date: Wed, 16 Mar 2011 18:00:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org (gdb-patches ml) In-Reply-To: <1300242390.5316.11.camel@hactar> from "Thiago Jung Bauermann" at Mar 15, 2011 11:26:30 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2011-03/txt/msg00865.txt.bz2 Thiago Jung Bauermann wrote: > On Mon, 2011-03-14 at 21:01 +0100, Ulrich Weigand wrote: > > Thus I'd prefer to not duplicate the logic in ui_out_field_core_addr, > > but rather just call it twice (using a temporary stream). > > ui_out_field_core_addr takes a struct ui_out, so I don't know how to > make it print to a temporary stream so I can call it twice from > print_one_detail_ranged_breakpoint without having to specify a different > field name in each call. What about putting the address-printing logic > in a function which uses a temporary stream, then make both > ui_out_field_core_addr and print_one_detail_ranged_breakpoint use it? > The patch below implements the idea. OK, I like that ... Maybe it would be even better to move the new routine into utils.c next to paddress, the only other routine to format addresses at the moment? This could e.g. take the form of a routine const char * paddress_padded (struct gdbarch *gdbarch, CORE_ADDR addr) which returns a string just like paddress, but padded to at least 8 or 16 characters, depending on the address size. ui_out_field_core_addr (and print_one_detail_ranged_breakpoint) could then just use this to print into a temporary stream ... Thanks, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com