binutils-gdb/gdb/nat
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
..
aarch64-hw-point.c nat: Split out platform-independent aarch64 debug register support. 2022-03-22 12:05:43 -07:00
aarch64-hw-point.h nat: Split out platform-independent aarch64 debug register support. 2022-03-22 12:05:43 -07:00
aarch64-linux-hw-point.c nat: Split out platform-independent aarch64 debug register support. 2022-03-22 12:05:43 -07:00
aarch64-linux-hw-point.h nat: Split out platform-independent aarch64 debug register support. 2022-03-22 12:05:43 -07:00
aarch64-linux.c nat: Split out platform-independent aarch64 debug register support. 2022-03-22 12:05:43 -07:00
aarch64-linux.h
aarch64-mte-linux-ptrace.c
aarch64-mte-linux-ptrace.h
aarch64-sve-linux-ptrace.c
aarch64-sve-linux-ptrace.h
aarch64-sve-linux-sigcontext.h
amd64-linux-siginfo.c
amd64-linux-siginfo.h
fork-inferior.c
fork-inferior.h
gdb_ptrace.h
gdb_thread_db.h
glibc_thread_db.h
linux-btrace.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
linux-btrace.h
linux-namespaces.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
linux-namespaces.h
linux-nat.h
linux-osdata.c
linux-osdata.h
linux-personality.c
linux-personality.h
linux-procfs.c Constify target_pid_to_exec_file 2022-05-13 08:21:16 -06:00
linux-procfs.h Constify target_pid_to_exec_file 2022-05-13 08:21:16 -06:00
linux-ptrace.c
linux-ptrace.h
linux-waitpid.c
linux-waitpid.h
mips-linux-watch.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
mips-linux-watch.h
netbsd-nat.c
netbsd-nat.h
ppc-linux.c
ppc-linux.h
riscv-linux-tdesc.c
riscv-linux-tdesc.h
windows-nat.c Use strwinerror in gdb/windows-nat.c 2022-08-16 08:04:37 -06:00
windows-nat.h Use subclasses of windows_process_info 2022-06-07 11:44:53 -06:00
x86-cpuid.h
x86-dregs.c internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
x86-dregs.h
x86-gcc-cpuid.h
x86-linux-dregs.c
x86-linux-dregs.h
x86-linux.c
x86-linux.h