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
This commit is contained in:
parent
5c831a3c7f
commit
f34652de0b
152 changed files with 467 additions and 752 deletions
|
@ -213,8 +213,7 @@ m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
|
|||
return;
|
||||
}
|
||||
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("Got request for bad register number %d."), regno);
|
||||
internal_error (_("Got request for bad register number %d."), regno);
|
||||
}
|
||||
|
||||
/* Store register REGNO back into the child process. If REGNO is -1,
|
||||
|
@ -233,8 +232,7 @@ m32r_linux_nat_target::store_registers (struct regcache *regcache, int regno)
|
|||
return;
|
||||
}
|
||||
|
||||
internal_error (__FILE__, __LINE__,
|
||||
_("Got request to store bad register number %d."), regno);
|
||||
internal_error (_("Got request to store bad register number %d."), regno);
|
||||
}
|
||||
|
||||
void _initialize_m32r_linux_nat ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue