From patchwork Fri Jan 29 15:47:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 10669 Received: (qmail 102968 invoked by alias); 29 Jan 2016 15:47:57 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 102957 invoked by uid 89); 29 Jan 2016 15:47:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=tabs X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 29 Jan 2016 15:47:55 +0000 Received: from EUSAAHC005.ericsson.se (Unknown_Domain [147.117.188.87]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id 24.F5.06940.EB68BA65; Fri, 29 Jan 2016 16:35:27 +0100 (CET) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.89) with Microsoft SMTP Server id 14.3.248.2; Fri, 29 Jan 2016 10:47:52 -0500 Subject: Re: [PATCH] Fix two misleading indentation warnings To: Yao Qi References: <1454006626-10564-1-git-send-email-simon.marchi@ericsson.com> <86mvropjyo.fsf@gmail.com> CC: From: Simon Marchi Message-ID: <56AB89A8.80601@ericsson.com> Date: Fri, 29 Jan 2016 10:47:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <86mvropjyo.fsf@gmail.com> X-IsSubscribed: yes On 16-01-29 08:57 AM, Yao Qi wrote: > It is a bug. The code here is to record the Advanced SIMD instructions > which load/store multiple elements into multiple registers. So the > "reg_rt" should be updated in each iteration, and we should write these > two lines into the "for" loop body. > > Do you want me to fix that or you want to adjust your patch and fix it > by yourself? Either is OK to me. Thanks! Here is an updated patch, with both aarch64 and xcoffread fixed. From b60f4ff32d9e821acaf411046b09f20ea6f7b866 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 28 Jan 2016 13:43:46 -0500 Subject: [PATCH] Fix two misleading indentation warnings Two small changes so everything builds with latest GCC and its -Wmisleading-indentation. In the aarch64-tdep.c case, the two misindented lines should actually be part of the for loop. It looks like the indentation is all done using spaces in that file though... I fixed it (changed for tabs + spaces) for the lines I touched. In the xcoffread.c case, we can simply remove the braces and fix the indentation. gdb/ChangeLog: * aarch64-tdep.c (aarch64_record_asimd_load_store): Add braces to for include additional lines. * xcoffread.c (scan_xcoff_symtab): Remove unnecessary braces. --- gdb/aarch64-tdep.c | 20 +++++++++++--------- gdb/xcoffread.c | 13 ++++++------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index c7da618..798a1b7 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3192,15 +3192,17 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r) else { for (sindex = 0; sindex < selem; sindex++) - if (bit (aarch64_insn_r->aarch64_insn, 22)) - record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM; - else - { - record_buf_mem[mem_index++] = esize / 8; - record_buf_mem[mem_index++] = address + addr_offset; - } - addr_offset = addr_offset + (esize / 8); - reg_rt = (reg_rt + 1) % 32; + { + if (bit (aarch64_insn_r->aarch64_insn, 22)) + record_buf[reg_index++] = reg_rt + AARCH64_V0_REGNUM; + else + { + record_buf_mem[mem_index++] = esize / 8; + record_buf_mem[mem_index++] = address + addr_offset; + } + addr_offset = addr_offset + (esize / 8); + reg_rt = (reg_rt + 1) % 32; + } } } /* Load/store multiple structure. */ diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 533a33a..c670949 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2381,13 +2381,12 @@ scan_xcoff_symtab (struct objfile *objfile) if (first_fun_line_offset == 0 && symbol.n_numaux > 1) first_fun_line_offset = main_aux[0].x_sym.x_fcnary.x_fcn.x_lnnoptr; - { - record_minimal_symbol - (namestring, symbol.n_value, - sclass == C_HIDEXT ? mst_file_text : mst_text, - symbol.n_scnum, objfile); - misc_func_recorded = 1; - } + + record_minimal_symbol + (namestring, symbol.n_value, + sclass == C_HIDEXT ? mst_file_text : mst_text, + symbol.n_scnum, objfile); + misc_func_recorded = 1; break; case XMC_GL: