From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116527 invoked by alias); 25 Jun 2017 10:58:23 -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 116282 invoked by uid 89); 25 Jun 2017 10:58:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=yep X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Jun 2017 10:58:02 +0000 Received: by simark.ca (Postfix, from userid 33) id CA48F1E5A1; Sun, 25 Jun 2017 06:58:00 -0400 (EDT) To: Sergio Durigan Junior Subject: Re: [PATCH 2/4] x86-dregs: Print debug registers one per line X-PHP-Originating-Script: 33:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 25 Jun 2017 10:58:00 -0000 From: Simon Marchi Cc: Simon Marchi , gdb-patches@sourceware.org In-Reply-To: <9e9b1f0cd2508412684ac7817f2dd397@polymtl.ca> References: <1498076108-29914-1-git-send-email-simon.marchi@ericsson.com> <1498076108-29914-3-git-send-email-simon.marchi@ericsson.com> <87injpccb9.fsf@sergiodj.net> <9e9b1f0cd2508412684ac7817f2dd397@polymtl.ca> Message-ID: <8562f1def8dc2c5732422423b0f290d9@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.2.5 X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00684.txt.bz2 On 2017-06-21 23:06, Simon Marchi wrote: > On 2017-06-21 22:31, Sergio Durigan Junior wrote: >> On Wednesday, June 21 2017, Simon Marchi wrote: >> >>> This get around this warning given by clang... >>> >>> /home/emaisin/src/binutils-gdb/gdb/nat/x86-dregs.c:209:7: error: >>> variable 'i' is incremented both in the loop header and in the loop >>> body [-Werror,-Wfor-loop-analysis] >>> i++; >>> ^ >>> /home/emaisin/src/binutils-gdb/gdb/nat/x86-dregs.c:199:32: note: >>> incremented here >>> ALL_DEBUG_ADDRESS_REGISTERS (i) >>> ^ >>> >>> ... I decided in the end to simply print the debug registers one per >>> line. I don't think it particularly helps readability to have them >>> two >>> per line anyway. >> >> Agreed, one per line sounds better to me. >> >>> >>> gdb/ChangeLog: >>> >>> * nat/x86-dregs.c (x86_show_dr): Print registers one per line. >>> --- >>> gdb/nat/x86-dregs.c | 16 ++++++---------- >>> 1 file changed, 6 insertions(+), 10 deletions(-) >>> >>> diff --git a/gdb/nat/x86-dregs.c b/gdb/nat/x86-dregs.c >>> index 8c8adfa..58b1179 100644 >>> --- a/gdb/nat/x86-dregs.c >>> +++ b/gdb/nat/x86-dregs.c >>> @@ -193,20 +193,16 @@ x86_show_dr (struct x86_debug_reg_state *state, >>> here. */ >>> : "??unknown??")))); >>> debug_printf (":\n"); >>> - debug_printf ("\tCONTROL (DR7): %s STATUS (DR6): %s\n", >>> - phex (state->dr_control_mirror, 8), >>> - phex (state->dr_status_mirror, 8)); >>> + >>> + debug_printf ("\tCONTROL (DR7): 0x%s\n",phex >>> (state->dr_control_mirror, 8)); >> ^^^ >> >> Space after comma? > > Yep, thanks. > >>> + debug_printf ("\tSTATUS (DR6): 0x%s\n", phex >>> (state->dr_status_mirror, 8)); >>> + >>> ALL_DEBUG_ADDRESS_REGISTERS (i) >>> { >>> - debug_printf ("\ >>> -\tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n", >>> + debug_printf ("\tDR%d: addr=0x%s, ref.count=%d\n", >>> i, phex (state->dr_mirror[i], >>> x86_get_debug_register_length ()), >>> - state->dr_ref_count[i], >>> - i + 1, phex (state->dr_mirror[i + 1], >>> - x86_get_debug_register_length ()), >>> - state->dr_ref_count[i + 1]); >>> - i++; >>> + state->dr_ref_count[i]); >>> } >>> } >>> >>> -- >>> 2.7.4 >> >> LGTM. Thanks, > > Thanks! This is now pushed.