[0/2] Fix tab vs spaces in generated gdbarch.c

Message ID 20221201223914.366184-1-thiago.bauermann@linaro.org
Headers
Series Fix tab vs spaces in generated gdbarch.c |

Message

Thiago Jung Bauermann Dec. 1, 2022, 10:39 p.m. UTC
  Hello,

If you change gdbarch-components.py and submit a patch containing the
generated gdbarch.c file, git will point out that it contains whitespace
errors, e.g.:

Applying: gdb/aarch64: Detect vector length changes when debugging remotely
.git/rebase-apply/patch:164: indent with spaces.
                       "gdbarch_dump: update_architecture = <%s>\n",
.git/rebase-apply/patch:165: indent with spaces.
                       host_address_to_string (gdbarch->update_architecture));
.git/rebase-apply/patch:186: indent with spaces.
                                  gdbarch_update_architecture_ftype update_architecture)
warning: 3 lines add whitespace errors.

These patches make gdbarch.py generate indentation using tabs and spaces
as required by the GNU coding style. The first patch also takes the
opportunity to align the function arguments with the opening parenthesis
in the line above.

In both patches, “git show --ignore-all-space” confirms that gdbarch.c has
only whitespace changes.

Thiago Jung Bauermann (2):
  gdbarch.py: Fix indentation in the generated gdbarch_dump function
  gdbarch.py: Fix indentation in the generated set_gdbarch_* definitions

 gdb/gdbarch.c  | 1502 ++++++++++++++++++++++++------------------------
 gdb/gdbarch.py |   29 +-
 2 files changed, 767 insertions(+), 764 deletions(-)


base-commit: 55fc1623f942fba10362cb199f9356d75ca5835b
  

Comments

Simon Marchi Dec. 2, 2022, 2:44 p.m. UTC | #1
On 12/1/22 17:39, Thiago Jung Bauermann via Gdb-patches wrote:
> Hello,
> 
> If you change gdbarch-components.py and submit a patch containing the
> generated gdbarch.c file, git will point out that it contains whitespace
> errors, e.g.:
> 
> Applying: gdb/aarch64: Detect vector length changes when debugging remotely
> .git/rebase-apply/patch:164: indent with spaces.
>                        "gdbarch_dump: update_architecture = <%s>\n",
> .git/rebase-apply/patch:165: indent with spaces.
>                        host_address_to_string (gdbarch->update_architecture));
> .git/rebase-apply/patch:186: indent with spaces.
>                                   gdbarch_update_architecture_ftype update_architecture)
> warning: 3 lines add whitespace errors.

Oh, and it's because Andrew added this to .gitattributes:

https://gitlab.com/gnutools/binutils-gdb/-/commit/f7f904e4fda6fb571d40a3547ed03ec6028e6694

I didn't remember that.

Simon