Makefiles: Flatten and sort file lists

I find the big file lists in the Makefiles a bit ugly and not very
practical.  Since there are multiple filenames on each line (as much as
fits in 80 columns), it's not easy to add, remove or change a name in
the middle.  As a result, we have a mix of long and short lines in no
particular order (ALL_TARGET_OBS is a good example).

I therefore suggest flattening the lists (one name per line) and keeping
them in alphabetical order.  The diffs will be much clearer and merge
conflicts will be easier to resolve.

A nice (IMO) side-effect I observed is that the files are compiled
alphabetically by make, so it gives a rough idea of the progress of the
build.

I added a comment in gdb/Makefile.in to mention to keep the file lists
ordered, and gave the general guidelines on what order to respect.  I
added a comment in other Makefiles which refers to gdb/Makefile.in, to
avoid duplication.

Running the patch through the buildbot found that gdb.base/default.exp
started to fail.  The languages in the error message shown when typing
"set language" have changed order.  We could probably improve gdb so
that it prints them in a stable order, regardless of the order of the
object list passed to the linked, but just fixing the test is easier for
now.

New in v2:

 - Change ordering style, directories go at the end.
 - Cleanup gdbserver's and data-directory's Makefile as well.
 - Add comments at top of Makefiles about the ordering.
 - Remove wrong trailing backslahes.
 - Fix test gdb.base/default.exp.

gdb/ChangeLog:

	* Makefile.in: Add comment about file lists ordering.
	(SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_MI_OBS, SUBDIR_MI_SRCS,
	SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS, SUBDIR_GCC_COMPILE_OBS,
	SUBDIR_GCC_COMPILE_SRCS, SUBDIR_GUILE_OBS, SUBDIR_GUILE_SRCS,
	SUBDIR_PYTHON_OBS, SUBDIR_PYTHON_SRCS, SUBDIR_GDBTK_OBS,
	SUBDIR_GDBTK_SRCS, XMLFILES, REMOTE_OBS, ALL_64_TARGET_OBS,
	ALL_TARGET_OBS, SFILES, HFILES_NO_SRCDIR, HFILES_WITH_SRCDIR,
	COMMON_OBS, YYFILES, YYOBJ, generated_files, ALLDEPFILES):
	Flatten list and order alphabetically.
	* data-directory/Makefile.in: Add comment about file lists
	ordering.
	(GEN_SYSCALLS_FILES, PYTHON_FILE_LIST): Flatten list and order
	alphabetically.

gdb/gdbserver/ChangeLog:

	* Makefile.in (SFILES, OBS): Flatten list and order
	alphabetically.

gdb/testsuite/ChangeLog:

	* gdb.base/default.exp: Fix output of "set language".
This commit is contained in:
Simon Marchi 2016-11-22 16:14:22 -05:00 committed by Simon Marchi
parent 1a9ccd70f9
commit b593ecca85
7 changed files with 1348 additions and 427 deletions

View File

@ -1,3 +1,19 @@
2016-11-22 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Add comment about file lists ordering.
(SUBDIR_CLI_OBS, SUBDIR_CLI_SRCS, SUBDIR_MI_OBS, SUBDIR_MI_SRCS,
SUBDIR_TUI_OBS, SUBDIR_TUI_SRCS, SUBDIR_GCC_COMPILE_OBS,
SUBDIR_GCC_COMPILE_SRCS, SUBDIR_GUILE_OBS, SUBDIR_GUILE_SRCS,
SUBDIR_PYTHON_OBS, SUBDIR_PYTHON_SRCS, SUBDIR_GDBTK_OBS,
SUBDIR_GDBTK_SRCS, XMLFILES, REMOTE_OBS, ALL_64_TARGET_OBS,
ALL_TARGET_OBS, SFILES, HFILES_NO_SRCDIR, HFILES_WITH_SRCDIR,
COMMON_OBS, YYFILES, YYOBJ, generated_files, ALLDEPFILES):
Flatten list and order alphabetically.
* data-directory/Makefile.in: Add comment about file lists
ordering.
(GEN_SYSCALLS_FILES, PYTHON_FILE_LIST): Flatten list and order
alphabetically.
2016-11-22 Ambrogino Modigliani <ambrogino.modigliani@gmail.com>
* contrib/expect-read1.sh: Fix spelling in comments.

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Please keep lists in this file sorted alphabetically, with one item per line.
# See gdb/Makefile.in for guidelines on ordering files and directories.
srcdir = @srcdir@
SYSCALLS_SRCDIR = $(srcdir)/../syscalls
PYTHON_SRCDIR = $(srcdir)/../python/lib
@ -45,12 +48,20 @@ GDB_DATADIR = @GDB_DATADIR@
SYSCALLS_DIR = syscalls
SYSCALLS_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSCALLS_DIR)
GEN_SYSCALLS_FILES = arm-linux.xml aarch64-linux.xml \
ppc-linux.xml ppc64-linux.xml \
i386-linux.xml amd64-linux.xml \
sparc-linux.xml sparc64-linux.xml \
mips-o32-linux.xml mips-n32-linux.xml mips-n64-linux.xml \
s390-linux.xml s390x-linux.xml
GEN_SYSCALLS_FILES = \
aarch64-linux.xml \
amd64-linux.xml \
arm-linux.xml \
i386-linux.xml \
mips-n32-linux.xml \
mips-n64-linux.xml \
mips-o32-linux.xml \
ppc-linux.xml \
ppc64-linux.xml \
s390-linux.xml \
s390x-linux.xml \
sparc-linux.xml \
sparc64-linux.xml
SYSCALLS_FILES = gdb-syscalls.dtd freebsd.xml $(GEN_SYSCALLS_FILES)
@ -58,22 +69,22 @@ PYTHON_DIR = python
PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR)
PYTHON_FILE_LIST = \
gdb/__init__.py \
gdb/frames.py \
gdb/FrameIterator.py \
gdb/FrameDecorator.py \
gdb/types.py \
gdb/FrameIterator.py \
gdb/frames.py \
gdb/printing.py \
gdb/unwinder.py \
gdb/prompt.py \
gdb/types.py \
gdb/unwinder.py \
gdb/xmethod.py \
gdb/command/__init__.py \
gdb/command/xmethods.py \
gdb/command/explore.py \
gdb/command/frame_filters.py \
gdb/command/unwinders.py \
gdb/command/type_printers.py \
gdb/command/pretty_printers.py \
gdb/command/prompt.py \
gdb/command/explore.py \
gdb/command/type_printers.py \
gdb/command/unwinders.py \
gdb/command/xmethods.py \
gdb/function/__init__.py \
gdb/function/as_string.py \
gdb/function/caller_is.py \

View File

@ -1,3 +1,8 @@
2016-11-22 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in (SFILES, OBS): Flatten list and order
alphabetically.
2016-11-23 Pedro Alves <palves@redhat.com>
* event-loop.c (handle_file_event): Use warning.

View File

@ -15,6 +15,9 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Please keep lists in this file sorted alphabetically, with one item per line.
# See gdb/Makefile.in for guidelines on ordering files and directories.
prefix = @prefix@
exec_prefix = @exec_prefix@
@ -146,43 +149,74 @@ INTERNAL_LDFLAGS = $(LDFLAGS) @RDYNAMIC@
# All source files that go into linking GDB remote server.
SFILES= $(srcdir)/gdbreplay.c $(srcdir)/inferiors.c $(srcdir)/dll.c \
$(srcdir)/mem-break.c $(srcdir)/proc-service.c \
$(srcdir)/proc-service.list $(srcdir)/regcache.c \
$(srcdir)/remote-utils.c $(srcdir)/server.c $(srcdir)/target.c \
$(srcdir)/thread-db.c $(srcdir)/utils.c $(srcdir)/debug.c \
SFILES = \
$(srcdir)/debug.c \
$(srcdir)/dll.c \
$(srcdir)/gdbreplay.c \
$(srcdir)/hostio.c \
$(srcdir)/hostio-errno.c \
$(srcdir)/i387-fp.c \
$(srcdir)/inferiors.c \
$(srcdir)/linux-aarch64-low.c \
$(srcdir)/linux-arm-low.c $(srcdir)/linux-bfin-low.c \
$(srcdir)/linux-cris-low.c $(srcdir)/linux-crisv32-low.c \
${srcdir}/x86-low.c $(srcdir)/i387-fp.c \
$(srcdir)/linux-ia64-low.c $(srcdir)/linux-low.c \
$(srcdir)/linux-arm-low.c \
$(srcdir)/linux-bfin-low.c \
$(srcdir)/linux-cris-low.c \
$(srcdir)/linux-crisv32-low.c \
$(srcdir)/linux-ia64-low.c \
$(srcdir)/linux-low.c \
$(srcdir)/linux-m32r-low.c \
$(srcdir)/linux-m68k-low.c $(srcdir)/linux-mips-low.c \
$(srcdir)/linux-m68k-low.c \
$(srcdir)/linux-mips-low.c \
$(srcdir)/linux-nios2-low.c \
$(srcdir)/linux-ppc-low.c $(srcdir)/nat/ppc-linux.c \
$(srcdir)/linux-ppc-low.c \
$(srcdir)/linux-s390-low.c \
$(srcdir)/linux-sh-low.c $(srcdir)/linux-sparc-low.c \
$(srcdir)/linux-sh-low.c \
$(srcdir)/linux-sparc-low.c \
$(srcdir)/linux-tile-low.c \
$(srcdir)/linux-x86-low.c \
$(srcdir)/linux-xtensa-low.c \
$(srcdir)/linux-tile-low.c \
$(srcdir)/win32-arm-low.c $(srcdir)/win32-i386-low.c \
$(srcdir)/win32-low.c $(srcdir)/wincecompat.c \
$(srcdir)/hostio.c $(srcdir)/hostio-errno.c \
$(srcdir)/common/vec.c $(srcdir)/common/gdb_vecs.c \
$(srcdir)/common/common-utils.c $(srcdir)/common/xml-utils.c \
$(srcdir)/nat/linux-osdata.c $(srcdir)/common/ptid.c \
$(srcdir)/nat/linux-personality.c \
$(srcdir)/common/buffer.c $(srcdir)/nat/linux-btrace.c \
$(srcdir)/common/filestuff.c $(srcdir)/target/waitstatus.c \
$(srcdir)/nat/mips-linux-watch.c $(srcdir)/common/print-utils.c \
$(srcdir)/common/rsp-low.c $(srcdir)/common/errors.c \
$(srcdir)/common/common-debug.c $(srcdir)/common/cleanups.c \
$(srcdir)/common/common-exceptions.c $(srcdir)/symbol.c \
$(srcdir)/mem-break.c \
$(srcdir)/proc-service.c \
$(srcdir)/proc-service.list \
$(srcdir)/regcache.c \
$(srcdir)/remote-utils.c \
$(srcdir)/server.c \
$(srcdir)/symbol.c \
$(srcdir)/target.c \
$(srcdir)/thread-db.c \
$(srcdir)/utils.c \
$(srcdir)/win32-arm-low.c \
$(srcdir)/win32-i386-low.c \
$(srcdir)/win32-low.c \
$(srcdir)/wincecompat.c \
$(srcdir)/x86-low.c \
$(srcdir)/arch/arm.c \
$(srcdir)/arch/arm-get-next-pcs.c \
$(srcdir)/arch/arm-linux.c \
$(srcdir)/common/btrace-common.c \
$(srcdir)/common/fileio.c $(srcdir)/nat/linux-namespaces.c \
$(srcdir)/arch/arm.c $(srcdir)/common/common-regcache.c \
$(srcdir)/arch/arm-linux.c $(srcdir)/arch/arm-get-next-pcs.c \
$(srcdir)/common/new-op.c
$(srcdir)/common/buffer.c \
$(srcdir)/common/cleanups.c \
$(srcdir)/common/common-debug.c \
$(srcdir)/common/common-exceptions.c \
$(srcdir)/common/common-regcache.c \
$(srcdir)/common/common-utils.c \
$(srcdir)/common/errors.c \
$(srcdir)/common/fileio.c \
$(srcdir)/common/filestuff.c \
$(srcdir)/common/gdb_vecs.c \
$(srcdir)/common/new-op.c \
$(srcdir)/common/print-utils.c \
$(srcdir)/common/ptid.c \
$(srcdir)/common/rsp-low.c \
$(srcdir)/common/vec.c \
$(srcdir)/common/xml-utils.c \
$(srcdir)/nat/linux-btrace.c \
$(srcdir)/nat/linux-namespaces.c \
$(srcdir)/nat/linux-osdata.c \
$(srcdir)/nat/linux-personality.c \
$(srcdir)/nat/mips-linux-watch.c \
$(srcdir)/nat/ppc-linux.c \
$(srcdir)/target/waitstatus.c
DEPFILES = @GDBSERVER_DEPFILES@
@ -191,14 +225,50 @@ LIBOBJS = @LIBOBJS@
SOURCES = $(SFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
OBS = agent.o ax.o inferiors.o regcache.o remote-utils.o server.o signals.o \
target.o waitstatus.o utils.o debug.o version.o vec.o gdb_vecs.o \
mem-break.o hostio.o event-loop.o tracepoint.o xml-utils.o \
common-utils.o ptid.o buffer.o format.o filestuff.o dll.o notif.o \
tdesc.o print-utils.o rsp-low.o errors.o common-debug.o cleanups.o \
common-exceptions.o symbol.o btrace-common.o fileio.o common-regcache.o \
signals-state-save-restore.o new-op.o \
$(XML_BUILTIN) $(DEPFILES) $(LIBOBJS)
OBS = \
agent.o \
ax.o \
btrace-common.o \
buffer.o \
cleanups.o \
common-debug.o \
common-exceptions.o \
common-regcache.o \
common-utils.o \
debug.o \
dll.o \
errors.o \
event-loop.o \
fileio.o \
filestuff.o \
format.o \
gdb_vecs.o \
hostio.o \
inferiors.o \
mem-break.o \
new-op.o \
notif.o \
print-utils.o \
ptid.o \
regcache.o \
remote-utils.o \
rsp-low.o \
server.o \
signals.o \
signals-state-save-restore.o \
symbol.o \
target.o \
tdesc.o \
tracepoint.o \
utils.o \
vec.o \
version.o \
waitstatus.o \
xml-utils.o \
$(DEPFILES) \
$(LIBOBJS) \
$(XML_BUILTIN)
GDBREPLAY_OBS = gdbreplay.o version.o
GDBSERVER_LIBS = @GDBSERVER_LIBS@
XM_CLIBS = @LIBS@

View File

@ -1,3 +1,7 @@
2016-11-22 Simon Marchi <simon.marchi@polymtl.ca>
* gdb.base/default.exp: Fix output of "set language".
2016-11-17 Simon Marchi <simon.marchi@polymtl.ca>
* Makefile.in: Remove @GMAKE_TRUE@ prefixes and removes lines

View File

@ -511,7 +511,7 @@ gdb_test "set history size" "Argument required .integer to set it to.*" "set his
#test set history
gdb_test "set history" "\"set history\" must be followed by the name of a history subcommand.(\[^\r\n\]*\[\r\n\])+List of set history subcommands:(\[^\r\n\]*\[\r\n\])+set history expansion -- Set history expansion on command input(\[^\r\n\]*\[\r\n\])+set history filename -- Set the filename in which to record the command history(\[^\r\n\]*\[\r\n\])+set history save -- Set saving of the history record on exit(\[^\r\n\]*\[\r\n\])+set history size -- Set the size of the command history(\[^\r\n\]*\[\r\n\])+Type \"help set history\" followed by set history subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set history"
#test set language
gdb_test "set language" "Requires an argument. Valid arguments are auto, local, unknown, ada, c, c.., asm, minimal, d, fortran, objective-c, go, modula-2, opencl, pascal, rust." "set language"
gdb_test "set language" "Requires an argument. Valid arguments are ada, c, c.., asm, minimal, d, fortran, go, auto, local, unknown, modula-2, objective-c, opencl, pascal, rust." "set language"
#test set listsize
gdb_test "set listsize" "Argument required .integer to set it to.*" "set listsize"
#test set print "p" abbreviation