binutils-gdb/gdb/compile
Pedro Alves f34652de0b internal_error: remove need to pass __FILE__/__LINE__
Currently, every internal_error call must be passed __FILE__/__LINE__
explicitly, like:

  internal_error (__FILE__, __LINE__, "foo %d", var);

The need to pass in explicit __FILE__/__LINE__ is there probably
because the function predates widespread and portable variadic macros
availability.  We can use variadic macros nowadays, and in fact, we
already use them in several places, including the related
gdb_assert_not_reached.

So this patch renames the internal_error function to something else,
and then reimplements internal_error as a variadic macro that expands
__FILE__/__LINE__ itself.

The result is that we now should call internal_error like so:

  internal_error ("foo %d", var);

Likewise for internal_warning.

The patch adjusts all calls sites.  99% of the adjustments were done
with a perl/sed script.

The non-mechanical changes are in gdbsupport/errors.h,
gdbsupport/gdb_assert.h, and gdb/gdbarch.py.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Ia6f372c11550ca876829e8fd85048f4502bdcf06
2022-10-19 15:32:36 +01:00
..
compile-c-support.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
compile-c-symbols.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
compile-c-types.c gdb: remove TYPE_LENGTH 2022-09-21 11:05:21 -04:00
compile-c.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-cplus-symbols.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
compile-cplus-types.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
compile-cplus.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-internal.h Introduce gdb-hashtab module in gdbsupport 2022-01-18 10:14:43 -07:00
compile-loc2c.c Change GDB to use frame_info_ptr 2022-10-10 11:57:10 +02:00
compile-object-load.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
compile-object-load.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile-object-run.c gdb, compile: unlink objfile stored in module 2022-10-18 14:16:09 +02:00
compile-object-run.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
compile.c gdb: remove BLOCKVECTOR_BLOCK and BLOCKVECTOR_NBLOCKS macros 2022-04-27 22:05:03 -04:00
compile.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gcc-c-plugin.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
gcc-cp-plugin.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00