* [PATCH] Fix two misleading indentation warnings
@ 2016-01-28 18:43 Simon Marchi
2016-01-29 13:57 ` Yao Qi
2016-01-29 14:08 ` Yao Qi
0 siblings, 2 replies; 6+ messages in thread
From: Simon Marchi @ 2016-01-28 18:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Two small changes so everything builds with latest GCC and its
-Wmisleading-indentation.
There is a slight possibility that these were actually bugs, and that the code
was meant to be included in the control structure just above, so I am not
pushing it as obvious.
gdb/ChangeLog:
* aarch64-tdep.c (aarch64_record_asimd_load_store): Fix
indentation.
* xcoffread.c (scan_xcoff_symtab): Likewise.
---
gdb/aarch64-tdep.c | 4 ++--
gdb/xcoffread.c | 14 +++++++-------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index c7da618..4ac4191 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -3199,8 +3199,8 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
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;
+ 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..938261a 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -2381,13 +2381,13 @@ 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:
--
2.5.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix two misleading indentation warnings
2016-01-28 18:43 [PATCH] Fix two misleading indentation warnings Simon Marchi
@ 2016-01-29 13:57 ` Yao Qi
2016-01-29 15:47 ` Simon Marchi
2016-01-29 14:08 ` Yao Qi
1 sibling, 1 reply; 6+ messages in thread
From: Yao Qi @ 2016-01-29 13:57 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
Simon Marchi <simon.marchi@ericsson.com> writes:
Hi Simon,
> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
> index c7da618..4ac4191 100644
> --- a/gdb/aarch64-tdep.c
> +++ b/gdb/aarch64-tdep.c
> @@ -3199,8 +3199,8 @@ aarch64_record_asimd_load_store (insn_decode_record *aarch64_insn_r)
> 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;
> + addr_offset = addr_offset + (esize / 8);
> + reg_rt = (reg_rt + 1) % 32;
> }
> }
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.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix two misleading indentation warnings
2016-01-28 18:43 [PATCH] Fix two misleading indentation warnings Simon Marchi
2016-01-29 13:57 ` Yao Qi
@ 2016-01-29 14:08 ` Yao Qi
1 sibling, 0 replies; 6+ messages in thread
From: Yao Qi @ 2016-01-29 14:08 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
Simon Marchi <simon.marchi@ericsson.com> writes:
Hi Simon,
> diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
> index 533a33a..938261a 100644
> --- a/gdb/xcoffread.c
> +++ b/gdb/xcoffread.c
> @@ -2381,13 +2381,13 @@ 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;
This looks an indentation issue. This block was added as a replacement
to RECORD_MINIMAL_SYMBOL which was indented correctly.
https://sourceware.org/ml/gdb-patches/2012-04/msg00440.html
A nit, can we remove the brackets ("{" and "}")? Change to xcoffread.c
looks good to me.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix two misleading indentation warnings
2016-01-29 13:57 ` Yao Qi
@ 2016-01-29 15:47 ` Simon Marchi
2016-01-29 17:47 ` Yao Qi
0 siblings, 1 reply; 6+ messages in thread
From: Simon Marchi @ 2016-01-29 15:47 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
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 <simon.marchi@ericsson.com>
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:
--
2.5.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix two misleading indentation warnings
2016-01-29 15:47 ` Simon Marchi
@ 2016-01-29 17:47 ` Yao Qi
2016-01-29 20:33 ` Simon Marchi
0 siblings, 1 reply; 6+ messages in thread
From: Yao Qi @ 2016-01-29 17:47 UTC (permalink / raw)
To: Simon Marchi; +Cc: Yao Qi, gdb-patches
Simon Marchi <simon.marchi@ericsson.com> writes:
> 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.
Patch is OK to me.
--
Yao (齐尧)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix two misleading indentation warnings
2016-01-29 17:47 ` Yao Qi
@ 2016-01-29 20:33 ` Simon Marchi
0 siblings, 0 replies; 6+ messages in thread
From: Simon Marchi @ 2016-01-29 20:33 UTC (permalink / raw)
To: Yao Qi; +Cc: gdb-patches
On 16-01-29 12:47 PM, Yao Qi wrote:
> Patch is OK to me.
Thank you, patch is pushed.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-29 20:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-28 18:43 [PATCH] Fix two misleading indentation warnings Simon Marchi
2016-01-29 13:57 ` Yao Qi
2016-01-29 15:47 ` Simon Marchi
2016-01-29 17:47 ` Yao Qi
2016-01-29 20:33 ` Simon Marchi
2016-01-29 14:08 ` Yao Qi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox