gdb: fix some indentation issues

I wrote a small script to spot a pattern of indentation mistakes I saw
happened in breakpoint.c.  And while at it I ran it on all files and
fixed what I found.  No behavior changes intended, just indentation and
addition / removal of curly braces.

gdb/ChangeLog:

	* Fix some indentation mistakes throughout.

gdbserver/ChangeLog:

	* Fix some indentation mistakes throughout.

Change-Id: Ia01990c26c38e83a243d8f33da1d494f16315c6e
This commit is contained in:
Simon Marchi 2021-05-27 15:01:28 -04:00
parent 055c879fcf
commit 01add95bed
29 changed files with 702 additions and 696 deletions

View file

@ -1,3 +1,7 @@
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
* Fix some indentation mistakes throughout.
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca> 2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.h (iterate_over_bp_locations): Remove. Update * breakpoint.h (iterate_over_bp_locations): Remove. Update

View file

@ -1617,8 +1617,9 @@ breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf,
content. */ content. */
if (bl->address >= bp_locations_placed_address_before_address_max if (bl->address >= bp_locations_placed_address_before_address_max
&& memaddr + len <= (bl->address && (memaddr + len
- bp_locations_placed_address_before_address_max)) <= (bl->address
- bp_locations_placed_address_before_address_max)))
break; break;
if (!bp_location_has_shadow (bl)) if (!bp_location_has_shadow (bl))
@ -3079,10 +3080,9 @@ remove_breakpoints (void)
int val = 0; int val = 0;
for (bp_location *bl : all_bp_locations ()) for (bp_location *bl : all_bp_locations ())
{
if (bl->inserted && !is_tracepoint (bl->owner)) if (bl->inserted && !is_tracepoint (bl->owner))
val |= remove_breakpoint (bl); val |= remove_breakpoint (bl);
}
return val; return val;
} }
@ -14931,9 +14931,7 @@ get_tracepoint_by_number (const char **arg,
for (breakpoint *t : all_tracepoints ()) for (breakpoint *t : all_tracepoints ())
if (t->number == tpnum) if (t->number == tpnum)
{
return (struct tracepoint *) t; return (struct tracepoint *) t;
}
printf_unfiltered ("No tracepoint number %d.\n", tpnum); printf_unfiltered ("No tracepoint number %d.\n", tpnum);
return NULL; return NULL;

View file

@ -4792,11 +4792,13 @@ rank_one_type (struct type *parm, struct type *arg, struct value *value)
return (sum_ranks (rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL), return (sum_ranks (rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL),
REFERENCE_SEE_THROUGH_BADNESS)); REFERENCE_SEE_THROUGH_BADNESS));
if (overload_debug) if (overload_debug)
{
/* Debugging only. */ /* Debugging only. */
fprintf_filtered (gdb_stderr, fprintf_filtered (gdb_stderr,
"------ Arg is %s [%d], parm is %s [%d]\n", "------ Arg is %s [%d], parm is %s [%d]\n",
arg->name (), arg->code (), arg->name (), arg->code (),
parm->name (), parm->code ()); parm->name (), parm->code ());
}
/* x -> y means arg of type x being supplied for parameter of type y. */ /* x -> y means arg of type x being supplied for parameter of type y. */

View file

@ -174,10 +174,8 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc)
sp = pc - pcoffs[attempt]; sp = pc - pcoffs[attempt];
} }
else else
{
return 0; return 0;
} }
}
/* sp + sfoffs[try] points to a struct rt_sigframe, which contains /* sp + sfoffs[try] points to a struct rt_sigframe, which contains
a struct siginfo and a struct ucontext. struct ucontext contains a struct siginfo and a struct ucontext. struct ucontext contains

View file

@ -4967,11 +4967,9 @@ static int i386_record_floats (struct gdbarch *gdbarch,
else if (I386_SAVE_FPU_ENV_REG_STACK == iregnum) else if (I386_SAVE_FPU_ENV_REG_STACK == iregnum)
{ {
for (i = I387_ST0_REGNUM (tdep); i <= I387_FOP_REGNUM (tdep); i++) for (i = I387_ST0_REGNUM (tdep); i <= I387_FOP_REGNUM (tdep); i++)
{
if (record_full_arch_list_add_reg (ir->regcache, i)) if (record_full_arch_list_add_reg (ir->regcache, i))
return -1; return -1;
} }
}
else if ((iregnum >= I387_ST0_REGNUM (tdep)) && else if ((iregnum >= I387_ST0_REGNUM (tdep)) &&
(iregnum <= I387_FOP_REGNUM (tdep))) (iregnum <= I387_FOP_REGNUM (tdep)))
{ {

View file

@ -1065,10 +1065,13 @@ ppc_displaced_step_fixup (struct gdbarch *gdbarch,
else if ((insn & BP_MASK) == BP_INSN) else if ((insn & BP_MASK) == BP_INSN)
regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch), from); regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch), from);
else else
/* Handle any other instructions that do not fit in the categories above. */ {
/* Handle any other instructions that do not fit in the categories
above. */
regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch), regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch),
from + offset); from + offset);
} }
}
/* Implementation of gdbarch_displaced_step_prepare. */ /* Implementation of gdbarch_displaced_step_prepare. */

View file

@ -2408,11 +2408,13 @@ tfind_line_command (const char *args, int from_tty)
} }
} }
else else
{
/* Is there any case in which we get here, and have an address /* Is there any case in which we get here, and have an address
which the user would want to see? If we have debugging which the user would want to see? If we have debugging
symbols and no line numbers? */ symbols and no line numbers? */
error (_("Line number %d is out of range for \"%s\"."), error (_("Line number %d is out of range for \"%s\"."),
sal.line, symtab_to_filename_for_display (sal.symtab)); sal.line, symtab_to_filename_for_display (sal.symtab));
}
/* Find within range of stated line. */ /* Find within range of stated line. */
if (args && *args) if (args && *args)

View file

@ -1025,12 +1025,14 @@ v850_push_dummy_call (struct gdbarch *gdbarch,
if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850) if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850)
stack_offset = 0; stack_offset = 0;
else else
{
/* The offset onto the stack at which we will start copying parameters /* The offset onto the stack at which we will start copying parameters
(after the registers are used up) begins at 16 rather than at zero. (after the registers are used up) begins at 16 rather than at zero.
That's how the ABI is defined, though there's no indication that these That's how the ABI is defined, though there's no indication that these
16 bytes are used for anything, not even for saving incoming 16 bytes are used for anything, not even for saving incoming
argument registers. */ argument registers. */
stack_offset = 16; stack_offset = 16;
}
/* Now make space on the stack for the args. */ /* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++) for (argnum = 0; argnum < nargs; argnum++)

View file

@ -482,7 +482,8 @@ arrange_linetable (struct linetable *oldLineTb)
newline = 0; newline = 0;
if (oldLineTb->item[0].line != 0) if (oldLineTb->item[0].line != 0)
for (newline = 0; for (newline = 0;
newline < oldLineTb->nitems && oldLineTb->item[newline].line; ++newline) newline < oldLineTb->nitems && oldLineTb->item[newline].line;
++newline)
newLineTb->item[newline] = oldLineTb->item[newline]; newLineTb->item[newline] = oldLineTb->item[newline];
/* Now copy function lines one by one. */ /* Now copy function lines one by one. */

View file

@ -1,3 +1,7 @@
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
* Fix some indentation mistakes throughout.
2021-05-17 Andrew Burgess <andrew.burgess@embecosm.com> 2021-05-17 Andrew Burgess <andrew.burgess@embecosm.com>
* .dir-locals.el: Set sentence-end-double-space for all modes, and * .dir-locals.el: Set sentence-end-double-space for all modes, and

View file

@ -1908,9 +1908,7 @@ s390_emit_const (LONGEST num)
0x98, 0x23, 0x10, 0x00, /* lm %r2, %r3, 0(%r1) */ 0x98, 0x23, 0x10, 0x00, /* lm %r2, %r3, 0(%r1) */
}; };
if (num < 0x8000 && num >= 0) if (num < 0x8000 && num >= 0)
{
add_insns (buf_s, sizeof buf_s); add_insns (buf_s, sizeof buf_s);
}
else else
{ {
s390_emit_litpool (8); s390_emit_litpool (8);
@ -2027,9 +2025,7 @@ s390_emit_set_r2 (int arg1)
0x58, 0x20, 0x10, 0x00, /* l %r2, 0(%r1) */ 0x58, 0x20, 0x10, 0x00, /* l %r2, 0(%r1) */
}; };
if (arg1 < 0x8000 && arg1 >= -0x8000) if (arg1 < 0x8000 && arg1 >= -0x8000)
{
add_insns (buf_s, sizeof buf_s); add_insns (buf_s, sizeof buf_s);
}
else else
{ {
s390_emit_litpool (4); s390_emit_litpool (4);
@ -2553,9 +2549,7 @@ s390x_emit_const (LONGEST num)
0xe3, 0x20, 0x10, 0x00, 0x00, 0x04, /* lg %r2, 0(%r1) */ 0xe3, 0x20, 0x10, 0x00, 0x00, 0x04, /* lg %r2, 0(%r1) */
}; };
if (num < 0x8000 && num >= -0x8000) if (num < 0x8000 && num >= -0x8000)
{
add_insns (buf_s, sizeof buf_s); add_insns (buf_s, sizeof buf_s);
}
else else
{ {
s390_emit_litpool (8); s390_emit_litpool (8);