binutils-gdb/gdb/cli
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
..
cli-cmds.c Change GDB to use frame_info_ptr 2022-10-10 11:57:10 +02:00
cli-cmds.h Remove two initialization functions 2022-08-19 08:23:20 -06:00
cli-decode.c Allow to document user-defined aliases. 2022-08-25 18:57:25 +02:00
cli-decode.h gdb/cli: convert cli_suppress_notification from int to bool 2022-02-07 08:26:55 +01:00
cli-dump.c gdb: remove TYPE_LENGTH 2022-09-21 11:05:21 -04:00
cli-interp.c Remove manual lifetime management from cli_interp 2022-07-18 08:49:55 -06:00
cli-interp.h Don't declare cli_set_logging 2022-06-23 14:26:13 -06:00
cli-logging.c Unify gdb printf functions 2022-03-29 12:46:24 -06:00
cli-option.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-option.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-script.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
cli-script.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-setshow.c GDB: Remove extraneous full stops from `set' command error messages 2022-06-29 15:27:41 +01:00
cli-setshow.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
cli-style.c gdb: add support for disassembler styling using libopcodes 2022-07-11 12:02:54 +01:00
cli-style.h gdb: add support for disassembler styling using libopcodes 2022-07-11 12:02:54 +01:00
cli-utils.c Unify gdb printf functions 2022-03-29 12:46:24 -06:00
cli-utils.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00