aboutsummaryrefslogtreecommitdiff
path: root/gdb/go32-nat.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2022-10-17 17:12:20 +0100
committerPedro Alves <pedro@palves.net>2022-10-19 15:32:36 +0100
commitf34652de0b68c4ee3050828b43a2839b852b5821 (patch)
tree851720f14f2ac022c3e82428254edf161d619e91 /gdb/go32-nat.c
parent5c831a3c7f3ca98d6aba1200353311e1a1f84c70 (diff)
downloadgdb-f34652de0b68c4ee3050828b43a2839b852b5821.zip
gdb-f34652de0b68c4ee3050828b43a2839b852b5821.tar.gz
gdb-f34652de0b68c4ee3050828b43a2839b852b5821.tar.bz2
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
Diffstat (limited to 'gdb/go32-nat.c')
-rw-r--r--gdb/go32-nat.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 475425d..4378266 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -544,8 +544,7 @@ fetch_register (struct regcache *regcache, int regno)
regno))
i387_supply_fsave (regcache, regno, &npx);
else
- internal_error (__FILE__, __LINE__,
- _("Invalid register no. %d in fetch_register."), regno);
+ internal_error (_("Invalid register no. %d in fetch_register."), regno);
}
void
@@ -574,8 +573,7 @@ store_register (const struct regcache *regcache, int regno)
regno))
i387_collect_fsave (regcache, regno, &npx);
else
- internal_error (__FILE__, __LINE__,
- _("Invalid register no. %d in store_register."), regno);
+ internal_error (_("Invalid register no. %d in store_register."), regno);
}
void
@@ -700,8 +698,7 @@ go32_nat_target::create_inferior (const char *exec_file,
/* Init command line storage. */
if (redir_debug_init (&child_cmd) == -1)
- internal_error (__FILE__, __LINE__,
- _("Cannot allocate redirection storage: "
+ internal_error (_("Cannot allocate redirection storage: "
"not enough memory.\n"));
/* Parse the command line and create redirections. */
@@ -800,8 +797,7 @@ static void
go32_set_dr (int i, CORE_ADDR addr)
{
if (i < 0 || i > 3)
- internal_error (__FILE__, __LINE__,
- _("Invalid register %d in go32_set_dr.\n"), i);
+ internal_error (_("Invalid register %d in go32_set_dr.\n"), i);
D_REGS[i] = addr;
}
@@ -841,8 +837,7 @@ static CORE_ADDR
go32_get_dr (int i)
{
if (i < 0 || i > 3)
- internal_error (__FILE__, __LINE__,
- _("Invalid register %d in go32_get_dr.\n"), i);
+ internal_error (_("Invalid register %d in go32_get_dr.\n"), i);
return D_REGS[i];
}
@@ -2086,8 +2081,7 @@ _initialize_go32_nat ()
/* Initialize child's command line storage. */
if (redir_debug_init (&child_cmd) == -1)
- internal_error (__FILE__, __LINE__,
- _("Cannot allocate redirection storage: "
+ internal_error (_("Cannot allocate redirection storage: "
"not enough memory.\n"));
/* We are always processing GCC-compiled programs. */