binutils-gdb/gdbsupport
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
..
.dir-locals.el
.gitattributes
acinclude.m4
aclocal.m4
agent.cc
agent.h
alt-stack.h
array-view.h
ax.def
block-signals.h
break-common.h
btrace-common.cc internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
btrace-common.h
buffer.cc
buffer.h
buildargv.h
byte-vector.h
ChangeLog-2020-2021
check-defines.el
cleanups.cc
cleanups.h
common-debug.cc
common-debug.h
common-defs.h [gdb] Add debug_{exp,val} 2022-08-05 08:09:57 +02:00
common-exceptions.cc internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
common-exceptions.h
common-gdbthread.h
common-inferior.cc
common-inferior.h
common-regcache.cc
common-regcache.h
common-types.h
common-utils.cc internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
common-utils.h
common.m4 gdb, gdbsupport: configure: factor out yes/no/auto value checking 2022-08-26 10:29:51 -04:00
compiler-type.m4
config.in
configure gdbsupport: re-generate configure 2022-10-09 21:27:37 -04:00
configure.ac gdbsupport: Fix config.status dependency 2022-09-08 11:03:12 +00:00
create-version.sh
def-vector.h
default-init-alloc.h
eintr.h
enum-flags.h
environ.cc
environ.h
errors.cc internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
errors.h internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
event-loop.cc internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
event-loop.h gdbsupport/event-loop: add a timeout parameter to gdb_do_one_event 2022-08-18 11:56:38 +02:00
event-pipe.cc
event-pipe.h
fileio.cc gdbsupport: move fileio_errno_to_host to fileio.{h,cc} and rename 2022-09-21 14:11:03 -04:00
fileio.h gdbsupport: move fileio_errno_to_host to fileio.{h,cc} and rename 2022-09-21 14:11:03 -04:00
filestuff.cc
filestuff.h
filtered-iterator.h
format.cc
format.h
forward-scope-exit.h
function-view.h gdbsupport: add wrapper around result_of and invoke_result 2022-08-30 14:43:26 -04:00
gdb_assert.h internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
gdb_binary_search.h
gdb_file.h
gdb_locale.h
gdb_obstack.cc
gdb_obstack.h
gdb_optional.h gdbsupport: fix gdb::optional compilation with C++11 && _GLIBCXX_DEBUG 2022-08-26 11:47:23 -04:00
gdb_proc_service.h
gdb_ref_ptr.h
gdb_regex.cc
gdb_regex.h
gdb_select.h
gdb_setjmp.h
gdb_signals.h
gdb_splay_tree.h
gdb_string_view.h
gdb_string_view.tcc
gdb_sys_time.h
gdb_tilde_expand.cc
gdb_tilde_expand.h
gdb_unique_ptr.h
gdb_unlinker.h
gdb_vecs.cc
gdb_vecs.h
gdb_wait.cc
gdb_wait.h
gdb-checked-static-cast.h gdbsupport: add checked_static_cast 2022-07-21 15:19:43 +01:00
gdb-dlfcn.cc
gdb-dlfcn.h
gdb-hashtab.cc
gdb-hashtab.h
gdb-safe-ctype.h
gdb-sigmask.h
gdb-xfree.h
hash_enum.h
host-defs.h
intrusive_list.h
invoke-result.h gdbsupport: add wrapper around result_of and invoke_result 2022-08-30 14:43:26 -04:00
iterator-range.h
job-control.cc
job-control.h
Makefile.am
Makefile.in gdbsupport: Fix config.status dependency 2022-09-08 11:03:12 +00:00
netstuff.cc
netstuff.h
new-op.cc
next-iterator.h
observable.h
offset-type.h
packed.h struct packed: Add fallback byte array implementation 2022-07-25 16:04:05 +01:00
parallel-for.h gdbsupport: add wrapper around result_of and invoke_result 2022-08-30 14:43:26 -04:00
pathstuff.cc gdbsupport: change path_join parameter to array_view<const char *> 2022-09-21 11:36:01 -04:00
pathstuff.h gdbsupport: change path_join parameter to array_view<const char *> 2022-09-21 11:36:01 -04:00
poison.h
preprocessor.h
print-utils.cc internal_error: remove need to pass __FILE__/__LINE__ 2022-10-19 15:32:36 +01:00
print-utils.h
ptid.cc
ptid.h
ptrace.m4
range-chain.h
README
refcounted-object.h
reference-to-pointer-iterator.h
rsp-low.cc
rsp-low.h
run-time-clock.cc
run-time-clock.h
safe-iterator.h
safe-strerror.cc
scope-exit.h
scoped_fd.h
scoped_ignore_signal.h
scoped_ignore_sigttou.h
scoped_mmap.cc
scoped_mmap.h
scoped_restore.h
search.cc
search.h
selftest.cc
selftest.h
selftest.m4
signals-state-save-restore.cc
signals-state-save-restore.h
signals.cc
symbol.h
tdesc.cc
tdesc.h
thread-pool.cc
thread-pool.h
traits.h
underlying.h
valid-expr.h
version.h
warning.m4
x86-xstate.h
xml-utils.cc
xml-utils.h

This is a helper library that is used by gdb and gdbserver.

To send patches, follow the gdb patch submission instructions in
../gdb/CONTRIBUTE.  For maintainers, see ../gdb/MAINTAINERS.