gdb, gdbserver, gdbsupport: trim trailing whitespaces

I noticed my IDE (VSCode) starting to automatically trim trailing
whitespaces on save, despite the setting for it being disabled.  I
realized that this is because the .editorconfig file now has

    trim_trailing_whitespace = true

for many file types.  If we have this EditorConfig setting forcing
editors to trim trailing whitespaces, I think it would make sense to
clean up trailing whitespaces from our files.  Otherwise, people will
always get spurious whitespace changes when editing these files.

I did a mass cleanup using this command:

$ find gdb gdbserver gdbsupport -type f \( \
    -name "*.c" -o \
    -name "*.h" -o \
    -name "*.cc" -o \
    -name "*.texi" -o \
    -name "*.exp" -o \
    -name "*.tcl" -o \
    -name "*.py" -o \
    -name "*.s" -o \
    -name "*.S" -o \
    -name "*.asm" -o \
    -name "*.awk" -o \
    -name "*.ac" -o \
    -name "Makefile*" -o \
    -name "*.sh" -o \
    -name "*.adb" -o \
    -name "*.ads" -o \
    -name "*.d" -o \
    -name "*.go" -o \
    -name "*.F90" -o \
    -name "*.f90" \
\) -exec sed -ri 's/[ \t]+$//' {} +

I then did an autotools regen, because we don't actually want to change
the Makefile and Makefile.in files that are generated.

Change-Id: I6f91b83e3b8c4dc7d5d51a2ebf60706120efe691
This commit is contained in:
Simon Marchi
2025-10-10 23:59:32 -04:00
committed by Simon Marchi
parent de49e8229b
commit a5cbe67512
497 changed files with 3067 additions and 3067 deletions

View File

@@ -247,7 +247,7 @@ gdb_do_one_event (int mstimeout)
std::optional<int> timer_id;
SCOPE_EXIT
SCOPE_EXIT
{
if (timer_id.has_value ())
delete_timer (*timer_id);
@@ -397,7 +397,7 @@ get_next_file_handler_to_handle_and_advance (void)
return curr_next;
}
/* Remove the file descriptor FD from the list of monitored fd's:
/* Remove the file descriptor FD from the list of monitored fd's:
i.e. we don't care anymore about events on the FD. */
void
delete_file_handler (int fd)
@@ -455,7 +455,7 @@ delete_file_handler (int fd)
}
}
/* Deactivate the file descriptor, by clearing its mask,
/* Deactivate the file descriptor, by clearing its mask,
so that it will not fire again. */
file_ptr->mask = 0;

View File

@@ -92,8 +92,8 @@ extern void add_file_handler (int fd, handler_func *proc,
gdb_client_data client_data,
std::string &&name, bool is_ui = false);
extern int create_timer (int milliseconds,
timer_handler_func *proc,
extern int create_timer (int milliseconds,
timer_handler_func *proc,
gdb_client_data client_data);
extern void delete_timer (int id);

View File

@@ -59,7 +59,7 @@ std::vector<gdb::unique_xmalloc_ptr<char>>
delim_string_to_char_ptr_vec (const char *str, char delimiter)
{
std::vector<gdb::unique_xmalloc_ptr<char>> retval;
delim_string_to_char_ptr_vec_append (&retval, str, delimiter);
return retval;
@@ -80,7 +80,7 @@ std::vector<gdb::unique_xmalloc_ptr<char>>
dirnames_to_char_ptr_vec (const char *dirnames)
{
std::vector<gdb::unique_xmalloc_ptr<char>> retval;
dirnames_to_char_ptr_vec_append (&retval, dirnames);
return retval;

View File

@@ -78,9 +78,9 @@ extern const char *hex_string_custom (LONGEST num, int width);
/* Convert VAL to a numeral in the given radix. For
* radix 10, IS_SIGNED may be true, indicating a signed quantity;
* otherwise VAL is interpreted as unsigned. If WIDTH is supplied,
* otherwise VAL is interpreted as unsigned. If WIDTH is supplied,
* it is the minimum width (0-padded if needed). USE_C_FORMAT means
* to use C format in all cases. If it is false, then 'x'
* to use C format in all cases. If it is false, then 'x'
* and 'o' formats do not include a prefix (0x or leading 0). */
extern const char *int_string (LONGEST val, int radix, int is_signed, int width,

View File

@@ -1,7 +1,7 @@
/* The ptid_t type and common functions operating on it.
Copyright (C) 1986-2025 Free Software Foundation, Inc.
This file is part of GDB.
This program is free software; you can redistribute it and/or modify