public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] internal_error: remove need to pass __FILE__/__LINE__
@ 2022-10-19 14:46 Pedro Alves
  0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2022-10-19 14:46 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f34652de0b68c4ee3050828b43a2839b852b5821

commit f34652de0b68c4ee3050828b43a2839b852b5821
Author: Pedro Alves <pedro@palves.net>
Date:   Mon Oct 17 17:12:20 2022 +0100

    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

Diff:
---
 gdb/aarch64-tdep.c                  | 11 +++----
 gdb/ada-exp.y                       |  3 +-
 gdb/ada-lang.c                      | 11 +++----
 gdb/addrmap.c                       |  6 ++--
 gdb/alpha-tdep.c                    | 12 +++----
 gdb/amd64-tdep.c                    |  2 +-
 gdb/arc-tdep.c                      |  6 ++--
 gdb/arch-utils.c                    | 33 +++++++------------
 gdb/arch/arm.c                      |  2 +-
 gdb/arm-linux-tdep.c                |  3 +-
 gdb/arm-netbsd-tdep.c               |  3 +-
 gdb/arm-tdep.c                      | 49 ++++++++++++----------------
 gdb/avr-tdep.c                      |  4 +--
 gdb/ax-gdb.c                        | 30 ++++++-----------
 gdb/ax-general.c                    |  6 ++--
 gdb/bfin-tdep.c                     |  6 ++--
 gdb/blockframe.c                    |  3 +-
 gdb/breakpoint.c                    | 41 ++++++++---------------
 gdb/btrace.c                        |  6 ++--
 gdb/c-exp.y                         |  5 ++-
 gdb/c-lang.c                        |  4 +--
 gdb/cli/cli-script.c                |  4 +--
 gdb/coffread.c                      |  2 +-
 gdb/compile/compile-c-support.c     |  2 +-
 gdb/compile/compile-c-symbols.c     |  2 +-
 gdb/compile/compile-cplus-symbols.c |  2 +-
 gdb/compile/compile-cplus-types.c   |  3 +-
 gdb/compile/compile-object-load.c   |  2 +-
 gdb/corefile.c                      |  3 +-
 gdb/cp-abi.c                        |  6 ++--
 gdb/cp-namespace.c                  |  3 +-
 gdb/cris-tdep.c                     |  9 ++---
 gdb/dbxread.c                       |  3 +-
 gdb/dictionary.c                    |  6 ++--
 gdb/dtrace-probe.c                  |  3 +-
 gdb/dwarf2/comp-unit-head.c         | 12 +++----
 gdb/dwarf2/expr.c                   | 10 +++---
 gdb/dwarf2/frame.c                  | 20 +++++-------
 gdb/dwarf2/leb.c                    |  3 +-
 gdb/dwarf2/loc.c                    |  4 +--
 gdb/elfread.c                       |  3 +-
 gdb/event-top.c                     |  2 +-
 gdb/exceptions.c                    |  2 +-
 gdb/exec.c                          |  3 +-
 gdb/fbsd-nat.c                      |  2 +-
 gdb/fbsd-tdep.c                     |  2 +-
 gdb/findvar.c                       |  6 ++--
 gdb/frame-unwind.c                  |  2 +-
 gdb/frame.c                         |  9 ++---
 gdb/frv-linux-tdep.c                |  2 +-
 gdb/frv-tdep.c                      |  8 ++---
 gdb/gdbarch.c                       |  3 +-
 gdb/gdbarch.py                      |  6 ++--
 gdb/gdbtypes.c                      |  5 ++-
 gdb/go32-nat.c                      | 18 ++++------
 gdb/h8300-tdep.c                    |  3 +-
 gdb/hppa-tdep.c                     |  6 ++--
 gdb/i386-linux-nat.c                |  6 ++--
 gdb/i386-tdep.c                     | 16 ++++-----
 gdb/i387-tdep.c                     |  5 ++-
 gdb/ia64-tdep.c                     |  3 +-
 gdb/infcall.c                       |  2 +-
 gdb/infcmd.c                        |  5 ++-
 gdb/infrun.c                        | 17 ++++------
 gdb/interps.c                       |  3 +-
 gdb/language.c                      | 17 ++++------
 gdb/linux-nat.c                     | 14 +++-----
 gdb/loongarch-tdep.c                |  3 +-
 gdb/m32c-tdep.c                     |  6 ++--
 gdb/m32r-linux-nat.c                |  6 ++--
 gdb/m68k-linux-nat.c                |  6 ++--
 gdb/m68k-tdep.c                     |  9 ++---
 gdb/macroexp.c                      |  5 ++-
 gdb/maint.c                         |  4 +--
 gdb/mi/mi-cmd-stack.c               |  3 +-
 gdb/mi/mi-getopt.c                  |  3 +-
 gdb/mi/mi-out.c                     |  4 +--
 gdb/microblaze-tdep.c               |  3 +-
 gdb/minsyms.c                       |  6 ++--
 gdb/mips-tdep.c                     | 51 +++++++++++++----------------
 gdb/mn10300-tdep.c                  | 11 +++----
 gdb/msp430-tdep.c                   |  3 +-
 gdb/nat/linux-btrace.c              |  4 +--
 gdb/nat/linux-namespaces.c          |  9 ++---
 gdb/nat/mips-linux-watch.c          | 21 ++++--------
 gdb/nat/x86-dregs.c                 |  9 +++--
 gdb/nds32-tdep.c                    |  9 ++---
 gdb/netbsd-tdep.c                   |  2 +-
 gdb/objfiles.h                      |  9 ++---
 gdb/osabi.c                         | 20 ++++--------
 gdb/ppc-linux-nat.c                 |  3 +-
 gdb/ppc-linux-tdep.c                |  2 +-
 gdb/ppc-sysv-tdep.c                 |  2 +-
 gdb/printcmd.c                      |  6 ++--
 gdb/process-stratum-target.c        |  3 +-
 gdb/psymtab.c                       |  3 +-
 gdb/record-btrace.c                 |  4 +--
 gdb/regcache.c                      |  6 ++--
 gdb/reggroups.c                     |  2 +-
 gdb/remote-sim.c                    |  6 ++--
 gdb/remote.c                        | 65 +++++++++++++------------------------
 gdb/riscv-tdep.c                    |  3 +-
 gdb/rl78-tdep.c                     |  3 +-
 gdb/rs6000-aix-nat.c                |  3 +-
 gdb/rs6000-tdep.c                   | 18 ++++------
 gdb/s390-tdep.c                     | 14 ++++----
 gdb/sentinel-frame.c                |  2 +-
 gdb/ser-event.c                     |  3 +-
 gdb/ser-mingw.c                     |  3 +-
 gdb/ser-unix.c                      |  3 +-
 gdb/serial.c                        |  3 +-
 gdb/source.c                        |  2 +-
 gdb/sparc-tdep.c                    |  3 +-
 gdb/sparc64-tdep.c                  |  5 ++-
 gdb/stack.c                         |  3 +-
 gdb/stap-probe.c                    |  9 ++---
 gdb/symtab.c                        |  3 +-
 gdb/target-descriptions.c           | 18 ++++------
 gdb/target.c                        | 20 ++++--------
 gdb/tic6x-tdep.c                    |  8 ++---
 gdb/tracectf.c                      |  2 +-
 gdb/tracefile-tfile.c               |  2 +-
 gdb/tracepoint.c                    |  8 ++---
 gdb/tui/tui-interp.c                |  2 +-
 gdb/ui-out.c                        | 30 ++++++-----------
 gdb/utils.c                         |  9 +++--
 gdb/valops.c                        |  5 ++-
 gdb/valprint.c                      |  3 +-
 gdb/value.c                         |  9 +++--
 gdb/windows-nat.c                   |  3 +-
 gdb/xml-support.c                   |  6 ++--
 gdb/xml-syscall.c                   |  3 +-
 gdb/xtensa-tdep.c                   | 17 ++++------
 gdbserver/ax.cc                     |  3 +-
 gdbserver/linux-amd64-ipa.cc        |  9 ++---
 gdbserver/linux-arm-low.cc          |  4 +--
 gdbserver/linux-i386-ipa.cc         |  5 ++-
 gdbserver/linux-low.cc              | 20 ++++--------
 gdbserver/linux-ppc-ipa.cc          |  3 +-
 gdbserver/linux-s390-ipa.cc         |  3 +-
 gdbserver/mem-break.cc              |  3 +-
 gdbserver/regcache.cc               |  2 +-
 gdbserver/remote-utils.cc           |  3 +-
 gdbserver/tracepoint.cc             | 50 ++++++++++------------------
 gdbsupport/btrace-common.cc         | 10 +++---
 gdbsupport/common-exceptions.cc     | 10 +++---
 gdbsupport/common-utils.cc          |  2 +-
 gdbsupport/errors.cc                |  4 +--
 gdbsupport/errors.h                 | 18 +++++++---
 gdbsupport/event-loop.cc            |  3 +-
 gdbsupport/gdb_assert.h             |  8 ++---
 gdbsupport/print-utils.cc           | 11 +++----
 152 files changed, 467 insertions(+), 752 deletions(-)

diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 32e85794ca5..d9ddc84a140 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1278,8 +1278,7 @@ aarch64_dwarf2_prev_register (frame_info_ptr this_frame,
       return frame_unwind_got_constant (this_frame, regnum, lr);
 
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Unexpected register %d"), regnum);
+      internal_error (_("Unexpected register %d"), regnum);
     }
 }
 
@@ -2663,8 +2662,7 @@ aarch64_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
   if (tdep->has_pauth () && regnum == tdep->ra_sign_state_regnum)
     return "";
 
-  internal_error (__FILE__, __LINE__,
-		  _("aarch64_pseudo_register_name: bad register number %d"),
+  internal_error (_("aarch64_pseudo_register_name: bad register number %d"),
 		  p_regnum);
 }
 
@@ -2703,8 +2701,7 @@ aarch64_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
   if (tdep->has_pauth () && regnum == tdep->ra_sign_state_regnum)
     return builtin_type (gdbarch)->builtin_uint64;
 
-  internal_error (__FILE__, __LINE__,
-		  _("aarch64_pseudo_register_type: bad register number %d"),
+  internal_error (_("aarch64_pseudo_register_type: bad register number %d"),
 		  p_regnum);
 }
 
@@ -3503,7 +3500,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
   uint64_t vq = aarch64_get_tdesc_vq (info.target_desc);
 
   if (vq > AARCH64_MAX_SVE_VQ)
-    internal_error (__FILE__, __LINE__, _("VQ out of bounds: %s (max %d)"),
+    internal_error (_("VQ out of bounds: %s (max %d)"),
 		    pulongest (vq), AARCH64_MAX_SVE_VQ);
 
   /* If there is already a candidate, use it.  */
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 7b4d6cc6484..225d3acbac4 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -1659,8 +1659,7 @@ write_var_or_type (struct parser_state *par_state,
 	      write_selectors (par_state, encoded_name + tail_index);
 	      return NULL;
 	    default:
-	      internal_error (__FILE__, __LINE__,
-			      _("impossible value from ada_parse_renaming"));
+	      internal_error (_("impossible value from ada_parse_renaming"));
 	    }
 
 	  if (type_sym != NULL)
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index a24b1b5b8ef..383f96bdc45 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -12005,7 +12005,7 @@ ada_exception_name_addr_1 (enum ada_exception_catchpoint_kind ex)
 	break;
 
       default:
-	internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+	internal_error (_("unexpected catchpoint type"));
 	break;
     }
 
@@ -12475,7 +12475,7 @@ ada_catchpoint::print_one (bp_location **last_loc) const
 	break;
 
       default:
-	internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+	internal_error (_("unexpected catchpoint type"));
 	break;
     }
 
@@ -12529,7 +12529,7 @@ ada_catchpoint::print_mention () const
 	break;
 
       default:
-	internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+	internal_error (_("unexpected catchpoint type"));
 	break;
     }
 }
@@ -12561,7 +12561,7 @@ ada_catchpoint::print_recreate (struct ui_file *fp) const
 	break;
 
       default:
-	internal_error (__FILE__, __LINE__, _("unexpected catchpoint type"));
+	internal_error (_("unexpected catchpoint type"));
     }
   print_recreate_thread (fp);
 }
@@ -12676,8 +12676,7 @@ ada_exception_sym_name (enum ada_exception_catchpoint_kind ex)
 	return (data->exception_info->catch_handlers_sym);
 	break;
       default:
-	internal_error (__FILE__, __LINE__,
-			_("unexpected catchpoint kind (%d)"), ex);
+	internal_error (_("unexpected catchpoint kind (%d)"), ex);
     }
 }
 
diff --git a/gdb/addrmap.c b/gdb/addrmap.c
index 8c357fbf7e5..9c46bd7bed1 100644
--- a/gdb/addrmap.c
+++ b/gdb/addrmap.c
@@ -34,8 +34,7 @@ void
 addrmap_fixed::set_empty (CORE_ADDR start, CORE_ADDR end_inclusive,
 			  void *obj)
 {
-  internal_error (__FILE__, __LINE__,
-		  "addrmap_fixed_set_empty: "
+  internal_error ("addrmap_fixed_set_empty: "
 		  "fixed addrmaps can't be changed\n");
 }
 
@@ -301,8 +300,7 @@ void
 addrmap_mutable::relocate (CORE_ADDR offset)
 {
   /* Not needed yet.  */
-  internal_error (__FILE__, __LINE__,
-		  _("addrmap_relocate is not implemented yet "
+  internal_error (_("addrmap_relocate is not implemented yet "
 		    "for mutable addrmaps"));
 }
 
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 646d4270636..99e51b8afec 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -494,8 +494,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("unknown floating point width"));
+	  internal_error (_("unknown floating point width"));
 	}
       break;
 
@@ -518,8 +517,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("unknown floating point width"));
+	  internal_error (_("unknown floating point width"));
 	}
       break;
 
@@ -563,8 +561,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
 	  error (_("Cannot set a 128-bit long double return value."));
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("unknown floating point width"));
+	  internal_error (_("unknown floating point width"));
 	}
       break;
 
@@ -588,8 +585,7 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
 	  error (_("Cannot set a 128-bit long double return value."));
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("unknown floating point width"));
+	  internal_error (_("unknown floating point width"));
 	}
       break;
 
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index ccdceeef0e5..a6894d82dbc 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1313,7 +1313,7 @@ amd64_get_unused_input_int_reg (const struct amd64_insn *details)
       }
 
     /* We shouldn't get here.  */
-    internal_error (__FILE__, __LINE__, _("unable to find free reg"));
+    internal_error (_("unable to find free reg"));
   }
 }
 
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index edca4d0803d..3ab0930bb29 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -1947,8 +1947,7 @@ mach_type_to_arc_isa (const unsigned long mach)
     case bfd_mach_arc_arcv2:
       return ARC_ISA_ARCV2;
     default:
-	internal_error (__FILE__, __LINE__,
-			_("unknown machine id %lu"), mach);
+	internal_error (_("unknown machine id %lu"), mach);
     }
 }
 
@@ -1973,8 +1972,7 @@ arc_arch_features_create (const bfd *abfd, const unsigned long mach)
       else if (eclass == ELFCLASS64)
 	reg_size = 8;
       else
-	internal_error (__FILE__, __LINE__,
-			_("unknown ELF header class %d"), eclass);
+	internal_error (_("unknown ELF header class %d"), eclass);
     }
 
   /* MACH from a bfd_arch_info struct is used here.  It should be a safe
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 6a72b3f5efd..5218bfc05e1 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -269,8 +269,7 @@ legacy_virtual_frame_pointer (struct gdbarch *gdbarch,
   else
     /* Should this be an internal error?  I guess so, it is reflecting
        an architectural limitation in the current design.  */
-    internal_error (__FILE__, __LINE__, 
-		    _("No virtual frame pointer available"));
+    internal_error (_("No virtual frame pointer available"));
   *frame_offset = 0;
 }
 
@@ -398,8 +397,7 @@ set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c)
     {
       target_byte_order_user = BFD_ENDIAN_UNKNOWN;
       if (! gdbarch_update_p (info))
-	internal_error (__FILE__, __LINE__,
-			_("set_endian: architecture update failed"));
+	internal_error (_("set_endian: architecture update failed"));
     }
   else if (set_endian_string == endian_little)
     {
@@ -420,8 +418,7 @@ set_endian (const char *ignore_args, int from_tty, struct cmd_list_element *c)
 	target_byte_order_user = BFD_ENDIAN_BIG;
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("set_endian: bad value"));
+    internal_error (_("set_endian: bad value"));
 
   show_endian (gdb_stdout, from_tty, NULL, NULL);
 }
@@ -557,15 +554,13 @@ set_architecture (const char *ignore_args,
     {
       target_architecture_user = NULL;
       if (!gdbarch_update_p (info))
-	internal_error (__FILE__, __LINE__,
-			_("could not select an architecture automatically"));
+	internal_error (_("could not select an architecture automatically"));
     }
   else
     {
       info.bfd_arch_info = bfd_scan_arch (set_architecture_string);
       if (info.bfd_arch_info == NULL)
-	internal_error (__FILE__, __LINE__,
-			_("set_architecture: bfd_scan_arch failed"));
+	internal_error (_("set_architecture: bfd_scan_arch failed"));
       if (gdbarch_update_p (info))
 	target_architecture_user = info.bfd_arch_info;
       else
@@ -700,13 +695,11 @@ initialize_current_architecture (void)
 	}
 
       if (chosen == NULL)
-	internal_error (__FILE__, __LINE__,
-			_("initialize_current_architecture: No arch"));
+	internal_error (_("initialize_current_architecture: No arch"));
 
       default_bfd_arch = bfd_scan_arch (chosen);
       if (default_bfd_arch == NULL)
-	internal_error (__FILE__, __LINE__,
-			_("initialize_current_architecture: Arch not found"));
+	internal_error (_("initialize_current_architecture: Arch not found"));
     }
 
   gdbarch_info info;
@@ -749,8 +742,7 @@ initialize_current_architecture (void)
   info.byte_order_for_code = info.byte_order;
 
   if (! gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__,
-		    _("initialize_current_architecture: Selection of "
+    internal_error (_("initialize_current_architecture: Selection of "
 		      "initial architecture failed"));
 
   /* Create the ``set architecture'' command appending ``auto'' to the
@@ -1233,8 +1225,7 @@ gdbarch_printable_names ()
       const struct bfd_arch_info *ap
 	= bfd_lookup_arch (rego->bfd_architecture, 0);
       if (ap == nullptr)
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch_architecture_names: multi-arch unknown"));
+	internal_error (_("gdbarch_architecture_names: multi-arch unknown"));
       do
 	{
 	  arches.push_back (ap->printable_name);
@@ -1259,8 +1250,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
   bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
   if (bfd_arch_info == NULL)
     {
-      internal_error (__FILE__, __LINE__,
-		      _("gdbarch: Attempt to register "
+      internal_error (_("gdbarch: Attempt to register "
 			"unknown architecture (%d)"),
 		      bfd_architecture);
     }
@@ -1270,8 +1260,7 @@ gdbarch_register (enum bfd_architecture bfd_architecture,
        curr = &(*curr)->next)
     {
       if (bfd_architecture == (*curr)->bfd_architecture)
-	internal_error (__FILE__, __LINE__,
-			_("gdbarch: Duplicate registration "
+	internal_error (_("gdbarch: Duplicate registration "
 			  "of architecture (%s)"),
 			bfd_arch_info->printable_name);
     }
diff --git a/gdb/arch/arm.c b/gdb/arch/arm.c
index 14f0a7a7f6c..b302276f8d1 100644
--- a/gdb/arch/arm.c
+++ b/gdb/arch/arm.c
@@ -194,7 +194,7 @@ arm_instruction_changes_pc (uint32_t this_instr)
 	return 0;
 
       default:
-	internal_error (__FILE__, __LINE__, _("bad value in switch"));
+	internal_error (_("bad value in switch"));
       }
 }
 
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index 7fa8a67ae42..27aca0c39e6 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -1759,8 +1759,7 @@ arm_linux_init_abi (struct gdbarch_info info,
       break;
     default:
       internal_error
-	(__FILE__, __LINE__,
-	 _("arm_linux_init_abi: Floating point model not supported"));
+	(_("arm_linux_init_abi: Floating point model not supported"));
       break;
     }
   tdep->jb_elt_size = ARM_LINUX_JB_ELEMENT_SIZE;
diff --git a/gdb/arm-netbsd-tdep.c b/gdb/arm-netbsd-tdep.c
index aa4d15df4c6..e92eef36a67 100644
--- a/gdb/arm-netbsd-tdep.c
+++ b/gdb/arm-netbsd-tdep.c
@@ -131,8 +131,7 @@ arm_netbsd_init_abi_common (struct gdbarch_info info,
       break;
 
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("arm_gdbarch_init: bad byte order for float format"));
+      internal_error (_("arm_gdbarch_init: bad byte order for float format"));
     }
 
   tdep->jb_pc = ARM_NBSD_JB_PC;
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index b5facae8a5e..2af6aa1eff1 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3692,11 +3692,11 @@ arm_m_exception_cache (frame_info_ptr this_frame)
       return cache;
     }
 
-  internal_error (__FILE__, __LINE__, _("While unwinding an exception frame, "
-					"found unexpected Link Register value "
-					"%s.  This should not happen and may "
-					"be caused by corrupt data or a bug in"
-					" GDB."),
+  internal_error (_("While unwinding an exception frame, "
+		    "found unexpected Link Register value "
+		    "%s.  This should not happen and may "
+		    "be caused by corrupt data or a bug in"
+		    " GDB."),
 		  phex (lr, ARM_INT_REGISTER_SIZE));
 }
 
@@ -3970,8 +3970,7 @@ arm_dwarf2_prev_register (frame_info_ptr this_frame, void **this_cache,
       return frame_unwind_got_constant (this_frame, regnum, val);
     }
 
-  internal_error (__FILE__, __LINE__,
-		  _("Unexpected register %d"), regnum);
+  internal_error (_("Unexpected register %d"), regnum);
 }
 
 /* Implement the stack_frame_destroyed_p gdbarch method.  */
@@ -4226,7 +4225,7 @@ arm_vfp_cprc_unit_length (enum arm_vfp_cprc_base_type b)
     case VFP_CPRC_VEC128:
       return 16;
     default:
-      internal_error (__FILE__, __LINE__, _("Invalid VFP CPRC type: %d."),
+      internal_error (_("Invalid VFP CPRC type: %d."),
 		      (int) b);
     }
 }
@@ -4248,7 +4247,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc_base_type b)
     case VFP_CPRC_VEC128:
       return 'q';
     default:
-      internal_error (__FILE__, __LINE__, _("Invalid VFP CPRC type: %d."),
+      internal_error (_("Invalid VFP CPRC type: %d."),
 		      (int) b);
     }
 }
@@ -5078,7 +5077,7 @@ arm_register_sim_regno (struct gdbarch *gdbarch, int regnum)
     return SIM_ARM_FPS_REGNUM + reg;
   reg -= NUM_SREGS;
 
-  internal_error (__FILE__, __LINE__, _("Bad REGNUM %d"), regnum);
+  internal_error (_("Bad REGNUM %d"), regnum);
 }
 
 static const unsigned char op_lit0 = DW_OP_lit0;
@@ -5484,8 +5483,7 @@ displaced_write_reg (regcache *regs, arm_displaced_step_copy_insn_closure *dsc,
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("Invalid argument to displaced_write_reg"));
+	  internal_error (_("Invalid argument to displaced_write_reg"));
 	}
 
       dsc->wrote_to_pc = 1;
@@ -6413,8 +6411,7 @@ arm_copy_extra_ld_st (struct gdbarch *gdbarch, uint32_t insn, int unprivileged,
   opcode = ((op2 << 2) | (op1 & 0x1) | ((op1 & 0x4) >> 1)) - 4;
 
   if (opcode < 0)
-    internal_error (__FILE__, __LINE__,
-		    _("copy_extra_ld_st: instruction decode error"));
+    internal_error (_("copy_extra_ld_st: instruction decode error"));
 
   dsc->tmp[0] = displaced_read_reg (regs, dsc, 0);
   dsc->tmp[1] = displaced_read_reg (regs, dsc, 1);
@@ -8167,8 +8164,7 @@ thumb_process_displaced_16bit_insn (struct gdbarch *gdbarch, uint16_t insn1,
     }
 
   if (err)
-    internal_error (__FILE__, __LINE__,
-		    _("thumb_process_displaced_16bit_insn: Instruction decode error"));
+    internal_error (_("thumb_process_displaced_16bit_insn: Instruction decode error"));
 }
 
 static int
@@ -8374,8 +8370,7 @@ thumb_process_displaced_32bit_insn (struct gdbarch *gdbarch, uint16_t insn1,
     }
 
   if (err)
-    internal_error (__FILE__, __LINE__,
-		    _("thumb_process_displaced_32bit_insn: Instruction decode error"));
+    internal_error (_("thumb_process_displaced_32bit_insn: Instruction decode error"));
 
 }
 
@@ -8455,8 +8450,7 @@ arm_process_displaced_insn (struct gdbarch *gdbarch, CORE_ADDR from,
     }
 
   if (err)
-    internal_error (__FILE__, __LINE__,
-		    _("arm_process_displaced_insn: Instruction decode error"));
+    internal_error (_("arm_process_displaced_insn: Instruction decode error"));
 }
 
 /* Actually set up the scratch space for a displaced instruction.  */
@@ -8767,8 +8761,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("arm_extract_return_value: "
+	  internal_error (_("arm_extract_return_value: "
 			    "Floating point model not supported"));
 	  break;
 	}
@@ -8975,8 +8968,7 @@ arm_store_return_value (struct type *type, struct regcache *regs,
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("arm_store_return_value: Floating "
+	  internal_error (_("arm_store_return_value: Floating "
 			    "point model not supported"));
 	  break;
 	}
@@ -9296,7 +9288,7 @@ arm_update_current_architecture (void)
   /* Update the architecture.  */
   gdbarch_info info;
   if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, _("could not update architecture"));
+    internal_error (_("could not update architecture"));
 }
 
 static void
@@ -9313,7 +9305,7 @@ set_fp_model_sfunc (const char *args, int from_tty,
       }
 
   if (fp_model == ARM_FLOAT_LAST)
-    internal_error (__FILE__, __LINE__, _("Invalid fp model accepted: %s."),
+    internal_error (_("Invalid fp model accepted: %s."),
 		    current_fp_model);
 
   arm_update_current_architecture ();
@@ -9353,7 +9345,7 @@ arm_set_abi (const char *args, int from_tty,
       }
 
   if (arm_abi == ARM_ABI_LAST)
-    internal_error (__FILE__, __LINE__, _("Invalid ABI accepted: %s."),
+    internal_error (_("Invalid ABI accepted: %s."),
 		    arm_abi_string);
 
   arm_update_current_architecture ();
@@ -10499,8 +10491,7 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       break;
 
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("arm_gdbarch_init: bad byte order for float format"));
+      internal_error (_("arm_gdbarch_init: bad byte order for float format"));
     }
 
   /* On ARM targets char defaults to unsigned.  */
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 41ffa046b40..bac0b3f5008 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -405,7 +405,7 @@ avr_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
       store_unsigned_integer (buf, 4, gdbarch_byte_order (gdbarch), val);
       return status;
     default:
-      internal_error (__FILE__, __LINE__, _("invalid regnum"));
+      internal_error (_("invalid regnum"));
     }
 }
 
@@ -423,7 +423,7 @@ avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
       regcache_raw_write_unsigned (regcache, AVR_PC_REGNUM, val);
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("invalid regnum"));
+      internal_error (_("invalid regnum"));
     }
 }
 
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index 3a223b34ba3..82e6e35dccf 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -400,8 +400,7 @@ gen_fetch (struct agent_expr *ax, struct type *type)
 	     implementing something we should be (this code's fault).
 	     In any case, it's a bug the user shouldn't see.  */
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("gen_fetch: strange size"));
+	  internal_error (_("gen_fetch: strange size"));
 	}
 
       gen_sign_extend (ax, type);
@@ -533,8 +532,7 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
       break;
 
     case LOC_CONST_BYTES:
-      internal_error (__FILE__, __LINE__,
-		      _("gen_var_ref: LOC_CONST_BYTES "
+      internal_error (_("gen_var_ref: LOC_CONST_BYTES "
 			"symbols are not supported"));
 
       /* Variable at a fixed location in memory.  Easy.  */
@@ -1096,8 +1094,7 @@ gen_deref (struct axs_value *value)
   /* The caller should check the type, because several operators use
      this, and we don't know what error message to generate.  */
   if (!value->type->is_pointer_or_reference ())
-    internal_error (__FILE__, __LINE__,
-		    _("gen_deref: expected a pointer"));
+    internal_error (_("gen_deref: expected a pointer"));
 
   /* We've got an rvalue now, which is a pointer.  We want to yield an
      lvalue, whose address is exactly that pointer.  So we don't
@@ -1200,8 +1197,7 @@ gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
 
   /* Can we fetch the number of bits requested at all?  */
   if ((end - start) > ((1 << num_ops) * 8))
-    internal_error (__FILE__, __LINE__,
-		    _("gen_bitfield_ref: bitfield too wide"));
+    internal_error (_("gen_bitfield_ref: bitfield too wide"));
 
   /* Note that we know here that we only need to try each opcode once.
      That may not be true on machines with weird byte sizes.  */
@@ -1362,8 +1358,7 @@ gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value,
 	    }
 #if 0 /* is this right? */
 	  if (this_name[0] == '\0')
-	    internal_error (__FILE__, __LINE__,
-			    _("find_field: anonymous unions not supported"));
+	    internal_error (_("find_field: anonymous unions not supported"));
 #endif
 	}
     }
@@ -1476,8 +1471,7 @@ gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value,
 
   if (t->code () != TYPE_CODE_STRUCT
       && t->code () != TYPE_CODE_UNION)
-    internal_error (__FILE__, __LINE__,
-		    _("non-aggregate type to gen_struct_elt_for_reference"));
+    internal_error (_("non-aggregate type to gen_struct_elt_for_reference"));
 
   for (i = t->num_fields () - 1; i >= TYPE_N_BASECLASSES (t); i--)
     {
@@ -1569,8 +1563,7 @@ gen_aggregate_elt_ref (struct agent_expr *ax, struct axs_value *value,
       return gen_namespace_elt (ax, value, type, field);
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("non-aggregate type in gen_aggregate_elt_ref"));
+      internal_error (_("non-aggregate type in gen_aggregate_elt_ref"));
     }
 
   return 0;
@@ -1654,8 +1647,7 @@ register_operation::do_generate_ax (struct expression *exp,
 
   reg = user_reg_map_name_to_regnum (ax->gdbarch, name, len);
   if (reg == -1)
-    internal_error (__FILE__, __LINE__,
-		    _("Register $%s not available"), name);
+    internal_error (_("Register $%s not available"), name);
   /* No support for tracing user registers yet.  */
   if (reg >= gdbarch_num_cooked_regs (ax->gdbarch))
     error (_("'%s' is a user-register; "
@@ -2214,8 +2206,7 @@ gen_expr_binop_rest (struct expression *exp,
     default:
       /* We should only list operators in the outer case statement
 	 that we actually handle in the inner case statement.  */
-      internal_error (__FILE__, __LINE__,
-		      _("gen_expr: op case sets don't match"));
+      internal_error (_("gen_expr: op case sets don't match"));
     }
 }
 
@@ -2254,8 +2245,7 @@ gen_expr_structop (struct expression *exp,
   else
     /* If this `if' chain doesn't handle it, then the case list
        shouldn't mention it, and we shouldn't be here.  */
-    internal_error (__FILE__, __LINE__,
-		    _("gen_expr: unhandled struct case"));
+    internal_error (_("gen_expr: unhandled struct case"));
 }
 
 /* A helper function that emits a unary operation.  */
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index c025aa214b4..758706ad662 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -309,8 +309,7 @@ ax_tsv (struct agent_expr *x, enum agent_op op, int num)
 {
   /* Make sure the tsv number is in range.  */
   if (num < 0 || num > 0xffff)
-    internal_error (__FILE__, __LINE__, 
-		    _("ax-general.c (ax_tsv): variable "
+    internal_error (_("ax-general.c (ax_tsv): variable "
 		      "number is %d, out of range"), num);
 
   grow_expr (x, 3);
@@ -332,8 +331,7 @@ ax_string (struct agent_expr *x, const char *str, int slen)
 
   /* Make sure the string length is reasonable.  */
   if (slen < 0 || slen > 0xffff)
-    internal_error (__FILE__, __LINE__, 
-		    _("ax-general.c (ax_string): string "
+    internal_error (_("ax-general.c (ax_string): string "
 		      "length is %d, out of allowed range"), slen);
 
   grow_expr (x, 2 + slen + 1);
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index cdaa8111472..f751e278211 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -696,8 +696,7 @@ bfin_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
   enum register_status status;
 
   if (regnum != BFIN_CC_REGNUM)
-    internal_error (__FILE__, __LINE__,
-		    _("invalid register number %d"), regnum);
+    internal_error (_("invalid register number %d"), regnum);
 
   /* Extract the CC bit from the ASTAT register.  */
   status = regcache->raw_read (BFIN_ASTAT_REGNUM, buf);
@@ -716,8 +715,7 @@ bfin_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
   gdb_byte buf[BFIN_MAX_REGISTER_SIZE];
 
   if (regnum != BFIN_CC_REGNUM)
-    internal_error (__FILE__, __LINE__,
-		    _("invalid register number %d"), regnum);
+    internal_error (_("invalid register number %d"), regnum);
 
   /* Overlay the CC bit in the ASTAT register.  */
   regcache->raw_read (BFIN_ASTAT_REGNUM, buf);
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index a1b4a476b0f..49bafa34b60 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -410,8 +410,7 @@ find_function_entry_range_from_pc (CORE_ADDR pc, const char **name,
 
       /* It's an internal error if we exit the above loop without finding
 	 the range.  */
-      internal_error (__FILE__, __LINE__,
-		      _("Entry block not found in find_function_entry_range_from_pc"));
+      internal_error (_("Entry block not found in find_function_entry_range_from_pc"));
     }
 
   return status;
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 91e13a03360..eb4dedf3f10 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -4721,8 +4721,7 @@ print_bp_stop_message (bpstat *bs)
       break;
 
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("print_bp_stop_message: unrecognized enum value"));
+      internal_error (_("print_bp_stop_message: unrecognized enum value"));
       break;
     }
 }
@@ -5838,8 +5837,7 @@ bpstat_what (bpstat *bs_head)
 	  /* Tracepoint hits should not be reported back to GDB, and
 	     if one got through somehow, it should have been filtered
 	     out already.  */
-	  internal_error (__FILE__, __LINE__,
-			  _("bpstat_what: tracepoint encountered"));
+	  internal_error (_("bpstat_what: tracepoint encountered"));
 	  break;
 	case bp_gnu_ifunc_resolver:
 	  /* Step over it (and insert bp_gnu_ifunc_resolver_return).  */
@@ -5859,8 +5857,7 @@ bpstat_what (bpstat *bs_head)
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("bpstat_what: unhandled bptype %d"), (int) bptype);
+	  internal_error (_("bpstat_what: unhandled bptype %d"), (int) bptype);
 	}
 
       retval.main_action = std::max (retval.main_action, this_action);
@@ -6127,8 +6124,7 @@ bptype_string (enum bptype type)
 
   if (((int) type >= (sizeof (bptypes) / sizeof (bptypes[0])))
       || ((int) type != bptypes[(int) type].type))
-    internal_error (__FILE__, __LINE__,
-		    _("bptypes table does not describe type #%d."),
+    internal_error (_("bptypes table does not describe type #%d."),
 		    (int) type);
 
   return bptypes[(int) type].description;
@@ -7231,7 +7227,7 @@ bp_location_from_bp_type (bptype type)
     case bp_static_marker_tracepoint:
       return bp_loc_other;
     default:
-      internal_error (__FILE__, __LINE__, _("unknown breakpoint type"));
+      internal_error (_("unknown breakpoint type"));
     }
 }
 
@@ -8244,8 +8240,7 @@ update_dprintf_command_list (struct breakpoint *b)
 	}
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("Invalid dprintf style."));
+    internal_error (_("Invalid dprintf style."));
 
   gdb_assert (printf_line != NULL);
 
@@ -9646,8 +9641,7 @@ watchpoint::print_mention () const
       tuple_name = "hw-awpt";
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Invalid hardware watchpoint type."));
+      internal_error (_("Invalid hardware watchpoint type."));
     }
 
   ui_out_emit_tuple tuple_emitter (uiout, tuple_name);
@@ -9674,8 +9668,7 @@ watchpoint::print_recreate (struct ui_file *fp) const
       gdb_printf (fp, "awatch");
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Invalid watchpoint type."));
+      internal_error (_("Invalid watchpoint type."));
     }
 
   gdb_printf (fp, " %s", exp_string.get ());
@@ -9783,8 +9776,7 @@ masked_watchpoint::print_it (const bpstat *bs) const
 	   async_reason_lookup (EXEC_ASYNC_ACCESS_WATCHPOINT_TRIGGER));
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Invalid hardware watchpoint type."));
+      internal_error (_("Invalid hardware watchpoint type."));
     }
 
   mention (b);
@@ -9835,8 +9827,7 @@ masked_watchpoint::print_mention () const
       tuple_name = "hw-awpt";
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Invalid hardware watchpoint type."));
+      internal_error (_("Invalid hardware watchpoint type."));
     }
 
   ui_out_emit_tuple tuple_emitter (uiout, tuple_name);
@@ -9863,8 +9854,7 @@ masked_watchpoint::print_recreate (struct ui_file *fp) const
       gdb_printf (fp, "awatch");
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Invalid hardware watchpoint type."));
+      internal_error (_("Invalid hardware watchpoint type."));
     }
 
   gdb_printf (fp, " %s mask 0x%s", exp_string.get (),
@@ -11684,8 +11674,7 @@ ordinary_breakpoint::print_recreate (struct ui_file *fp) const
   else if (type == bp_hardware_breakpoint)
     gdb_printf (fp, "hbreak");
   else
-    internal_error (__FILE__, __LINE__,
-		    _("unhandled breakpoint type %d"), (int) type);
+    internal_error (_("unhandled breakpoint type %d"), (int) type);
 
   gdb_printf (fp, " %s", locspec->to_string ());
 
@@ -11926,8 +11915,7 @@ tracepoint::print_mention () const
       gdb_printf (_(" %d"), number);
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("unhandled tracepoint type %d"), (int) type);
+      internal_error (_("unhandled tracepoint type %d"), (int) type);
     }
 
   say_where (this);
@@ -11944,8 +11932,7 @@ tracepoint::print_recreate (struct ui_file *fp) const
   else if (type == bp_tracepoint)
     gdb_printf (fp, "trace");
   else
-    internal_error (__FILE__, __LINE__,
-		    _("unhandled tracepoint type %d"), (int) type);
+    internal_error (_("unhandled tracepoint type %d"), (int) type);
 
   gdb_printf (fp, " %s", locspec->to_string ());
   print_recreate_thread (fp);
diff --git a/gdb/btrace.c b/gdb/btrace.c
index c4f0d4911ab..a8e6049265c 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -1512,7 +1512,7 @@ btrace_compute_ftrace_pt (struct thread_info *tp,
 			  const struct btrace_data_pt *btrace,
 			  std::vector<unsigned int> &gaps)
 {
-  internal_error (__FILE__, __LINE__, _("Unexpected branch trace format."));
+  internal_error (_("Unexpected branch trace format."));
 }
 
 #endif /* defined (HAVE_LIBIPT)  */
@@ -1548,7 +1548,7 @@ btrace_compute_ftrace_1 (struct thread_info *tp,
       return;
     }
 
-  internal_error (__FILE__, __LINE__, _("Unknown branch trace format."));
+  internal_error (_("Unknown branch trace format."));
 }
 
 static void
@@ -1808,7 +1808,7 @@ btrace_stitch_trace (struct btrace_data *btrace, struct thread_info *tp)
       return -1;
     }
 
-  internal_error (__FILE__, __LINE__, _("Unknown branch trace format."));
+  internal_error (_("Unknown branch trace format."));
 }
 
 /* Clear the branch trace histories in BTINFO.  */
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 5a3569a7606..2d010de8951 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -1036,8 +1036,7 @@ exp	:	string_exp
 				  break;
 				default:
 				  /* internal error */
-				  internal_error (__FILE__, __LINE__,
-						  "unrecognized type in string concatenation");
+				  internal_error ("unrecognized type in string concatenation");
 				}
 			    }
 
@@ -3216,7 +3215,7 @@ classify_inner_name (struct parser_state *par_state,
     default:
       return NAME;
     }
-  internal_error (__FILE__, __LINE__, _("not reached"));
+  internal_error (_("not reached"));
 }
 
 /* The outer level of a two-level lexer.  This calls the inner lexer
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 437f79c025a..36b4d1ae3dd 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -64,7 +64,7 @@ charset_for_string_type (c_string_type str_type, struct gdbarch *gdbarch)
       else
 	return "UTF-32LE";
     }
-  internal_error (__FILE__, __LINE__, _("unhandled c_string_type"));
+  internal_error (_("unhandled c_string_type"));
 }
 
 /* Classify ELTTYPE according to what kind of character it is.  Return
@@ -613,7 +613,7 @@ c_string_operation::evaluate (struct type *expect_type,
       type = lookup_typename (exp->language_defn, "char32_t", NULL, 0);
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("unhandled c_string_type"));
+      internal_error (_("unhandled c_string_type"));
     }
 
   /* Ensure TYPE_LENGTH is valid for TYPE.  */
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 22e3efa5643..2442f7ae38b 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -1489,7 +1489,7 @@ do_define_command (const char *comname, int from_tty,
 	  break;
 	default:
 	  /* Should never come here as hookc would be 0.  */
-	  internal_error (__FILE__, __LINE__, _("bad switch"));
+	  internal_error (_("bad switch"));
 	}
     }
 }
@@ -1621,7 +1621,7 @@ void
 script_from_file (FILE *stream, const char *file)
 {
   if (stream == NULL)
-    internal_error (__FILE__, __LINE__, _("called with NULL file pointer!"));
+    internal_error (_("called with NULL file pointer!"));
 
   scoped_restore restore_line_number
     = make_scoped_restore (&source_line_number, 0);
diff --git a/gdb/coffread.c b/gdb/coffread.c
index babf6bdbaa8..f29627d9797 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1360,7 +1360,7 @@ coff_getfilename (union internal_auxent *aux_entry)
   if (aux_entry->x_file.x_n.x_n.x_zeroes == 0)
     {
       if (strlen (stringtab + aux_entry->x_file.x_n.x_n.x_offset) >= BUFSIZ)
-	internal_error (__FILE__, __LINE__, _("coff file name too long"));
+	internal_error (_("coff file name too long"));
       strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_n.x_offset);
     }
   else
diff --git a/gdb/compile/compile-c-support.c b/gdb/compile/compile-c-support.c
index 19fcf00594f..c652c96217b 100644
--- a/gdb/compile/compile-c-support.c
+++ b/gdb/compile/compile-c-support.c
@@ -53,7 +53,7 @@ c_get_mode_for_size (int size)
       mode = "DI";
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("Invalid GCC mode size %d."), size);
+      internal_error (_("Invalid GCC mode size %d."), size);
     }
 
   return mode;
diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbols.c
index 3a5d70bfeb0..ad6daba27a0 100644
--- a/gdb/compile/compile-c-symbols.c
+++ b/gdb/compile/compile-c-symbols.c
@@ -115,7 +115,7 @@ convert_one_symbol (compile_c_instance *context,
 		 sym.symbol->print_name ());
 
 	case LOC_UNDEF:
-	  internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."),
+	  internal_error (_("LOC_UNDEF found for \"%s\"."),
 			  sym.symbol->print_name ());
 
 	case LOC_COMMON_BLOCK:
diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplus-symbols.c
index 4d3f1602322..b8e8e07a39d 100644
--- a/gdb/compile/compile-cplus-symbols.c
+++ b/gdb/compile/compile-cplus-symbols.c
@@ -109,7 +109,7 @@ convert_one_symbol (compile_cplus_instance *instance,
 		 sym.symbol->print_name ());
 
 	case LOC_UNDEF:
-	  internal_error (__FILE__, __LINE__, _("LOC_UNDEF found for \"%s\"."),
+	  internal_error (_("LOC_UNDEF found for \"%s\"."),
 			  sym.symbol->print_name ());
 
 	case LOC_COMMON_BLOCK:
diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-types.c
index 245345d1dbf..bd90753eae1 100644
--- a/gdb/compile/compile-cplus-types.c
+++ b/gdb/compile/compile-cplus-types.c
@@ -178,8 +178,7 @@ type_name_to_scope (const char *type_name, const struct block *block)
 	      /* This shouldn't happen since we are not attempting to
 		 loop over user input.  This name is generated by GDB
 		 from debug info.  */
-	      internal_error (__FILE__, __LINE__,
-			      _("malformed TYPE_NAME during parsing"));
+	      internal_error (_("malformed TYPE_NAME during parsing"));
 	    }
 	}
     }
diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
index f3573cb7c72..4c94ec53899 100644
--- a/gdb/compile/compile-object-load.c
+++ b/gdb/compile/compile-object-load.c
@@ -678,7 +678,7 @@ compile_object_load (const compile_file_names &file_names,
       expect_return_type = builtin_type (target_gdbarch ())->builtin_void;
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("invalid scope %d"), scope);
+      internal_error (_("invalid scope %d"), scope);
     }
   if (func_type->num_fields () != expect_parameters)
     error (_("Invalid %d parameters of function \"%s\" in compiled "
diff --git a/gdb/corefile.c b/gdb/corefile.c
index 6a226cc4755..bb423b7631b 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -173,8 +173,7 @@ memory_error_message (enum target_xfer_status err,
       return string_printf (_("Memory at address %s unavailable."),
 			    paddress (gdbarch, memaddr));
     default:
-      internal_error (__FILE__, __LINE__,
-		      "unhandled target_xfer_status: %s (%s)",
+      internal_error ("unhandled target_xfer_status: %s (%s)",
 		      target_xfer_status_to_string (err),
 		      plongest (err));
     }
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index f10117491ec..c32b1f7d2f0 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -251,8 +251,7 @@ int
 register_cp_abi (struct cp_abi_ops *abi)
 {
   if (num_cp_abis == CP_ABI_MAX)
-    internal_error (__FILE__, __LINE__,
-		    _("Too many C++ ABIs, please increase "
+    internal_error (_("Too many C++ ABIs, please increase "
 		      "CP_ABI_MAX in cp-abi.c"));
 
   cp_abis[num_cp_abis++] = abi;
@@ -268,8 +267,7 @@ set_cp_abi_as_auto_default (const char *short_name)
   struct cp_abi_ops *abi = find_cp_abi (short_name);
 
   if (abi == NULL)
-    internal_error (__FILE__, __LINE__,
-		    _("Cannot find C++ ABI \"%s\" to set it as auto default."),
+    internal_error (_("Cannot find C++ ABI \"%s\" to set it as auto default."),
 		    short_name);
 
   xfree ((char *) auto_cp_abi.longname);
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 1d7759a7669..634dab6ada0 100644
--- a/gdb/cp-namespace.c
+++ b/gdb/cp-namespace.c
@@ -977,8 +977,7 @@ cp_lookup_nested_symbol (struct type *parent_type,
       return {};
 
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("cp_lookup_nested_symbol called "
+      internal_error (_("cp_lookup_nested_symbol called "
 			"on a non-aggregate type."));
     }
 }
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 4a2f14ad076..d38850aa1af 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -3884,8 +3884,7 @@ set_cris_version (const char *ignore_args, int from_tty,
   
   /* Update the current architecture, if needed.  */
   if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, 
-		    _("cris_gdbarch_update: failed to update architecture."));
+    internal_error (_("cris_gdbarch_update: failed to update architecture."));
 }
 
 static void
@@ -3896,8 +3895,7 @@ set_cris_mode (const char *ignore_args, int from_tty,
 
   /* Update the current architecture, if needed.  */
   if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, 
-		    "cris_gdbarch_update: failed to update architecture.");
+    internal_error ("cris_gdbarch_update: failed to update architecture.");
 }
 
 static void
@@ -3908,8 +3906,7 @@ set_cris_dwarf2_cfi (const char *ignore_args, int from_tty,
 
   /* Update the current architecture, if needed.  */
   if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, 
-		    _("cris_gdbarch_update: failed to update architecture."));
+    internal_error (_("cris_gdbarch_update: failed to update architecture."));
 }
 
 static struct gdbarch *
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 1f93eb5aafd..b0047cf0e79 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -2711,8 +2711,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name,
 	  case N_ROSYM:
 	    goto case_N_ROSYM;
 	  default:
-	    internal_error (__FILE__, __LINE__,
-			    _("failed internal consistency check"));
+	    internal_error (_("failed internal consistency check"));
 	  }
       }
 
diff --git a/gdb/dictionary.c b/gdb/dictionary.c
index 849d07469cf..f87f183fe68 100644
--- a/gdb/dictionary.c
+++ b/gdb/dictionary.c
@@ -522,8 +522,7 @@ free_obstack (struct dictionary *dict)
 static void
 add_symbol_nonexpandable (struct dictionary *dict, struct symbol *sym)
 {
-  internal_error (__FILE__, __LINE__,
-		  _("dict_add_symbol: non-expandable dictionary"));
+  internal_error (_("dict_add_symbol: non-expandable dictionary"));
 }
 
 /* Functions for DICT_HASHED and DICT_HASHED_EXPANDABLE.  */
@@ -1094,8 +1093,7 @@ create_new_language_dictionary (struct multidictionary *mdict,
     {
     case DICT_HASHED:
     case DICT_LINEAR:
-      internal_error (__FILE__, __LINE__,
-		      _("create_new_language_dictionary: attempted to expand "
+      internal_error (_("create_new_language_dictionary: attempted to expand "
 			"non-expandable multidictionary"));
 
     case DICT_HASHED_EXPANDABLE:
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
index 44f3de22a01..14b35e8d41c 100644
--- a/gdb/dtrace-probe.c
+++ b/gdb/dtrace-probe.c
@@ -655,8 +655,7 @@ dtrace_probe::get_arg_by_number (unsigned n, struct gdbarch *gdbarch)
     this->build_arg_exprs (gdbarch);
 
   if (n > m_args.size ())
-    internal_error (__FILE__, __LINE__,
-		    _("Probe '%s' has %d arguments, but GDB is requesting\n"
+    internal_error (_("Probe '%s' has %d arguments, but GDB is requesting\n"
 		      "argument %u.  This should not happen.  Please\n"
 		      "report this bug."),
 		    this->get_name ().c_str (),
diff --git a/gdb/dwarf2/comp-unit-head.c b/gdb/dwarf2/comp-unit-head.c
index 5f78ac8c5b2..edb2a8aa55a 100644
--- a/gdb/dwarf2/comp-unit-head.c
+++ b/gdb/dwarf2/comp-unit-head.c
@@ -65,8 +65,7 @@ read_comp_unit_head (struct comp_unit_head *cu_header,
 	cu_header->unit_type = DW_UT_type;
 	break;
       default:
-	internal_error (__FILE__, __LINE__,
-			_("read_comp_unit_head: invalid section_kind"));
+	internal_error (_("read_comp_unit_head: invalid section_kind"));
       }
   else
     {
@@ -113,8 +112,7 @@ read_comp_unit_head (struct comp_unit_head *cu_header,
     }
   signed_addr = bfd_get_sign_extend_vma (abfd);
   if (signed_addr < 0)
-    internal_error (__FILE__, __LINE__,
-		    _("read_comp_unit_head: dwarf from non elf file"));
+    internal_error (_("read_comp_unit_head: dwarf from non elf file"));
   cu_header->signed_addr_p = signed_addr;
 
   bool header_has_signature = section_kind == rcuh_kind::TYPE
@@ -215,8 +213,7 @@ comp_unit_head::read_address (bfd *abfd, const gdb_byte *buf,
 	  retval = bfd_get_signed_64 (abfd, buf);
 	  break;
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("read_address: bad switch, signed [in module %s]"),
+	  internal_error (_("read_address: bad switch, signed [in module %s]"),
 			  bfd_get_filename (abfd));
 	}
     }
@@ -234,8 +231,7 @@ comp_unit_head::read_address (bfd *abfd, const gdb_byte *buf,
 	  retval = bfd_get_64 (abfd, buf);
 	  break;
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("read_address: bad switch, "
+	  internal_error (_("read_address: bad switch, "
 			    "unsigned [in module %s]"),
 			  bfd_get_filename (abfd));
 	}
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c
index 2df069602a3..73dfd4b4ffb 100644
--- a/gdb/dwarf2/expr.c
+++ b/gdb/dwarf2/expr.c
@@ -162,8 +162,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
   else
     {
       if (value_type (v) != value_enclosing_type (v))
-	internal_error (__FILE__, __LINE__,
-			_("Should not be able to create a lazy value with "
+	internal_error (_("Should not be able to create a lazy value with "
 			  "an enclosing type"));
       if (check_optimized)
 	v_contents = nullptr;
@@ -432,7 +431,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__, _("invalid location type"));
+	  internal_error (_("invalid location type"));
 	}
 
       offset += this_size_bits;
@@ -1057,7 +1056,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
 	  /* DWARF_VALUE_OPTIMIZED_OUT can't occur in this context --
 	     it can only be encountered when making a piece.  */
 	default:
-	  internal_error (__FILE__, __LINE__, _("invalid location type"));
+	  internal_error (_("invalid location type"));
 	}
     }
 
@@ -2103,8 +2102,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
 		result_val = value_from_ulongest (address_type, result);
 		break;
 	      default:
-		internal_error (__FILE__, __LINE__,
-				_("Can't be reached."));
+		internal_error (_("Can't be reached."));
 	      }
 	  }
 	  break;
diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c
index 83565ea7c99..d4bc53e5dd8 100644
--- a/gdb/dwarf2/frame.c
+++ b/gdb/dwarf2/frame.c
@@ -500,8 +500,7 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
 			   insn);
 		}
 	      else
-		internal_error (__FILE__, __LINE__,
-				_("Unknown CFI encountered."));
+		internal_error (_("Unknown CFI encountered."));
 	    }
 	}
     }
@@ -827,7 +826,7 @@ dwarf2_fetch_cfa_info (struct gdbarch *gdbarch, CORE_ADDR pc,
       return 0;
 
     default:
-      internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
+      internal_error (_("Unknown CFA rule."));
     }
 }
 
@@ -974,7 +973,7 @@ dwarf2_frame_cache (frame_info_ptr this_frame, void **this_cache)
 	  break;
 
 	default:
-	  internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
+	  internal_error (_("Unknown CFA rule."));
 	}
     }
   catch (const gdb_exception_error &ex)
@@ -1218,7 +1217,7 @@ dwarf2_frame_prev_register (frame_info_ptr this_frame, void **this_cache,
       return cache->reg[regnum].loc.fn (this_frame, this_cache, regnum);
 
     default:
-      internal_error (__FILE__, __LINE__, _("Unknown register rule."));
+      internal_error (_("Unknown register rule."));
     }
 }
 
@@ -1405,7 +1404,7 @@ encoding_for_size (unsigned int size)
     case 8:
       return DW_EH_PE_udata8;
     default:
-      internal_error (__FILE__, __LINE__, _("Unsupported address size"));
+      internal_error (_("Unsupported address size"));
     }
 }
 
@@ -1421,8 +1420,7 @@ read_encoded_value (struct comp_unit *unit, gdb_byte encoding,
   /* GCC currently doesn't generate DW_EH_PE_indirect encodings for
      FDE's.  */
   if (encoding & DW_EH_PE_indirect)
-    internal_error (__FILE__, __LINE__, 
-		    _("Unsupported encoding: DW_EH_PE_indirect"));
+    internal_error (_("Unsupported encoding: DW_EH_PE_indirect"));
 
   *bytes_read_ptr = 0;
 
@@ -1454,8 +1452,7 @@ read_encoded_value (struct comp_unit *unit, gdb_byte encoding,
 	}
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Invalid or unsupported encoding"));
+      internal_error (_("Invalid or unsupported encoding"));
     }
 
   if ((encoding & 0x07) == 0x00)
@@ -1502,8 +1499,7 @@ read_encoded_value (struct comp_unit *unit, gdb_byte encoding,
       *bytes_read_ptr += 8;
       return (base + bfd_get_signed_64 (unit->abfd, (bfd_byte *) buf));
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("Invalid or unsupported encoding"));
+      internal_error (_("Invalid or unsupported encoding"));
     }
 }
 \f
diff --git a/gdb/dwarf2/leb.c b/gdb/dwarf2/leb.c
index 75af98c554a..199a5b9e7a4 100644
--- a/gdb/dwarf2/leb.c
+++ b/gdb/dwarf2/leb.c
@@ -127,8 +127,7 @@ read_offset (bfd *abfd, const gdb_byte *buf, unsigned int offset_size)
       retval = bfd_get_64 (abfd, buf);
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("read_offset_1: bad switch [in module %s]"),
+      internal_error (_("read_offset_1: bad switch [in module %s]"),
 		      bfd_get_filename (abfd));
     }
 
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 791648d6e7e..c42359ab96e 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -739,7 +739,7 @@ call_site_target::iterate_over_addresses
       break;
 
     default:
-      internal_error (__FILE__, __LINE__, _("invalid call site target kind"));
+      internal_error (_("invalid call site target kind"));
     }
 }
 
@@ -3035,7 +3035,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
     {
       int targ = offsets[dw_labels[i]];
       if (targ == -1)
-	internal_error (__FILE__, __LINE__, _("invalid label"));
+	internal_error (_("invalid label"));
       ax_label (expr, patches[i], targ);
     }
 }
diff --git a/gdb/elfread.c b/gdb/elfread.c
index d7fa5a6de09..64aeb239670 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -1024,8 +1024,7 @@ elf_gnu_ifunc_resolver_return_stop (code_breakpoint *b)
 	  delete_breakpoint (b);
 	  break;
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("handle_inferior_event: Invalid "
+	  internal_error (_("handle_inferior_event: Invalid "
 			    "gnu-indirect-function breakpoint type %d"),
 			  (int) b->type);
 	}
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 88c53b720a9..0e371194ee3 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -399,7 +399,7 @@ display_gdb_prompt (const char *new_prompt)
       struct ui *ui = current_ui;
 
       if (ui->prompt_state == PROMPTED)
-	internal_error (__FILE__, __LINE__, _("double prompt"));
+	internal_error (_("double prompt"));
       else if (ui->prompt_state == PROMPT_BLOCKED)
 	{
 	  /* This is to trick readline into not trying to display the
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index fdb65b3dc4b..2a0dfb29217 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -97,7 +97,7 @@ print_exception (struct ui_file *file, const struct gdb_exception &e)
       annotate_error ();
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("Bad switch."));
+      internal_error (_("Bad switch."));
     }
 }
 
diff --git a/gdb/exec.c b/gdb/exec.c
index 40c89d53ba9..0890193faa3 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -123,8 +123,7 @@ set_exec_file_mismatch_command (const char *ignore,
 	  return;
 	}
       if (mode == exec_file_mismatch_off)
-	internal_error (__FILE__, __LINE__,
-			_("Unrecognized exec-file-mismatch setting: \"%s\""),
+	internal_error (_("Unrecognized exec-file-mismatch setting: \"%s\""),
 			exec_file_mismatch);
     }
 }
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index f38d5d8745b..ad26503a2ad 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -983,7 +983,7 @@ fbsd_nat_target::async (bool enable)
   if (enable)
     {
       if (!async_file_open ())
-	internal_error (__FILE__, __LINE__, "failed to create event pipe.");
+	internal_error ("failed to create event pipe.");
 
       add_file_handler (async_wait_fd (), handle_target_event, NULL, "fbsd-nat");
 
diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
index 8431caf8f59..bb5a8f3f61e 100644
--- a/gdb/fbsd-tdep.c
+++ b/gdb/fbsd-tdep.c
@@ -1925,7 +1925,7 @@ fbsd_get_syscall_number (struct gdbarch *gdbarch, thread_info *thread)
      However, system call catching requires this function to be
      set.  */
 
-  internal_error (__FILE__, __LINE__, _("fbsd_get_sycall_number called"));
+  internal_error (_("fbsd_get_sycall_number called"));
 }
 
 /* Read an integer symbol value from the current target.  */
diff --git a/gdb/findvar.c b/gdb/findvar.c
index d45a1583b79..91de3fd5c3e 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -153,8 +153,7 @@ CORE_ADDR
 extract_typed_address (const gdb_byte *buf, struct type *type)
 {
   if (!type->is_pointer_or_reference ())
-    internal_error (__FILE__, __LINE__,
-		    _("extract_typed_address: "
+    internal_error (_("extract_typed_address: "
 		    "type is not a pointer or reference"));
 
   return gdbarch_pointer_to_address (type->arch (), type, buf);
@@ -206,8 +205,7 @@ void
 store_typed_address (gdb_byte *buf, struct type *type, CORE_ADDR addr)
 {
   if (!type->is_pointer_or_reference ())
-    internal_error (__FILE__, __LINE__,
-		    _("store_typed_address: "
+    internal_error (_("store_typed_address: "
 		    "type is not a pointer or reference"));
 
   gdbarch_address_to_pointer (type->arch (), type, buf, addr);
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index ed24e6e1747..e535d41225c 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -207,7 +207,7 @@ frame_unwind_find_by_frame (frame_info_ptr this_frame, void **this_cache)
     if (frame_unwind_try_unwinder (this_frame, this_cache, entry->unwinder))
       return;
 
-  internal_error (__FILE__, __LINE__, _("frame_unwind_find_by_frame failed"));
+  internal_error (_("frame_unwind_find_by_frame failed"));
 }
 
 /* A default frame sniffer which always accepts the frame.  Used by
diff --git a/gdb/frame.c b/gdb/frame.c
index e08b9c90065..3ddc0d06996 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -988,8 +988,7 @@ frame_unwind_pc (frame_info_ptr this_frame)
   else if (this_frame->prev_pc.status == CC_NOT_SAVED)
     throw_error (OPTIMIZED_OUT_ERROR, _("PC not saved"));
   else
-    internal_error (__FILE__, __LINE__,
-		    "unexpected prev_pc status: %d",
+    internal_error ("unexpected prev_pc status: %d",
 		    (int) this_frame->prev_pc.status);
 }
 
@@ -3008,8 +3007,7 @@ unwind_stop_reason_to_string (enum unwind_stop_reason reason)
 #undef SET
 
     default:
-      internal_error (__FILE__, __LINE__,
-		      "Invalid frame stop reason");
+      internal_error ("Invalid frame stop reason");
     }
 }
 
@@ -3041,8 +3039,7 @@ frame_stop_reason_symbol_string (enum unwind_stop_reason reason)
 #undef SET
 
     default:
-      internal_error (__FILE__, __LINE__,
-		      "Invalid frame stop reason");
+      internal_error ("Invalid frame stop reason");
     }
 }
 
diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c
index 9a2593e10dc..41344c82370 100644
--- a/gdb/frv-linux-tdep.c
+++ b/gdb/frv-linux-tdep.c
@@ -215,7 +215,7 @@ frv_linux_sigcontext_reg_addr (frame_info_ptr this_frame, int regno,
 	  sc_addr += 24;
 	}
       else
-	internal_error (__FILE__, __LINE__, _("not a signal trampoline"));
+	internal_error (_("not a signal trampoline"));
 
       if (sc_addr_cache_ptr)
 	*sc_addr_cache_ptr = sc_addr;
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index a72f999f139..056aad3f17e 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -410,7 +410,7 @@ frv_register_sim_regno (struct gdbarch *gdbarch, int reg)
 	return SIM_FRV_SPR0_REGNUM + spr_reg_offset;
     }
 
-  internal_error (__FILE__, __LINE__, _("Bad register number %d"), reg);
+  internal_error (_("Bad register number %d"), reg);
 }
 
 constexpr gdb_byte frv_break_insn[] = {0xc0, 0x70, 0x00, 0x01};
@@ -1122,8 +1122,7 @@ frv_extract_return_value (struct type *type, struct regcache *regcache,
       store_unsigned_integer ((bfd_byte *) valbuf + 4, 4, byte_order, regval);
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("Illegal return value length: %d"), len);
+    internal_error (_("Illegal return value length: %d"), len);
 }
 
 static CORE_ADDR
@@ -1328,8 +1327,7 @@ frv_store_return_value (struct type *type, struct regcache *regcache,
       regcache->cooked_write (9, (bfd_byte *) valbuf + 4);
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("Don't know how to return a %d-byte value."), len);
+    internal_error (_("Don't know how to return a %d-byte value."), len);
 }
 
 static enum return_value_convention
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 559e92dee58..a096f2a9c2c 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -609,8 +609,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of get_pc_address_flags, invalid_p == 0 */
   /* Skip verify of read_core_file_mappings, invalid_p == 0 */
   if (!log.empty ())
-    internal_error (__FILE__, __LINE__,
-		    _("verify_gdbarch: the following are invalid ...%s"),
+    internal_error (_("verify_gdbarch: the following are invalid ...%s"),
 		    log.c_str ());
 }
 
diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py
index da848feae84..ae8a3f73fd6 100755
--- a/gdb/gdbarch.py
+++ b/gdb/gdbarch.py
@@ -373,8 +373,10 @@ with open("gdbarch.c", "w") as f:
             # here.
             raise Exception("unhandled case when generating gdbarch validation")
     print("  if (!log.empty ())", file=f)
-    print("    internal_error (__FILE__, __LINE__,", file=f)
-    print("""		    _("verify_gdbarch: the following are invalid ...%s"),""", file=f)
+    print(
+        """    internal_error (_("verify_gdbarch: the following are invalid ...%s"),""",
+        file=f,
+    )
     print("		    log.c_str ());", file=f)
     print("}", file=f)
     print(file=f)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 643bb0a14a3..ecccaf77405 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -4400,7 +4400,7 @@ check_types_equal (struct type *type1, struct type *type2,
 	      }
 	      break;
 	    default:
-	      internal_error (__FILE__, __LINE__, _("Unsupported field kind "
+	      internal_error (_("Unsupported field kind "
 						    "%d by check_types_equal"),
 			      field1->loc_kind ());
 	    }
@@ -5704,8 +5704,7 @@ copy_type_recursive (struct type *type, htab_t copied_types)
 		(type->field (i).loc_dwarf_block ());
               break;
 	    default:
-	      internal_error (__FILE__, __LINE__,
-			      _("Unexpected type field location kind: %d"),
+	      internal_error (_("Unexpected type field location kind: %d"),
 			      type->field (i).loc_kind ());
 	    }
 	}
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 475425d9f3b..437826616dc 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.  */
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 503c01bc8a9..38e7135601e 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1117,8 +1117,7 @@ static struct type *
 h8300_register_type (struct gdbarch *gdbarch, int regno)
 {
   if (regno < 0 || regno >= gdbarch_num_cooked_regs (gdbarch))
-    internal_error (__FILE__, __LINE__,
-		    _("h8300_register_type: illegal register number %d"),
+    internal_error (_("h8300_register_type: illegal register number %d"),
 		    regno);
   else
     {
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index e35e08b22c1..fb4c4b42eab 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -3028,7 +3028,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 					   hppa64_cannot_fetch_register);
 	break;
       default:
-	internal_error (__FILE__, __LINE__, _("Unsupported address size: %d"),
+	internal_error (_("Unsupported address size: %d"),
 			tdep->bytes_per_address);
     }
 
@@ -3077,7 +3077,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_frame_align (gdbarch, hppa64_frame_align);
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
       
   /* Struct return methods.  */
@@ -3090,7 +3090,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_return_value (gdbarch, hppa64_return_value);
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
       
   set_gdbarch_breakpoint_kind_from_pc (gdbarch, hppa_breakpoint::kind_from_pc);
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index e9b0f8a222f..294fb2ff17e 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -527,8 +527,7 @@ i386_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,
@@ -592,8 +591,7 @@ i386_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);
 }
 \f
 
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 59d4d7b976c..e027df2b9c5 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -476,7 +476,7 @@ i386_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
   else if (i386_word_regnum_p (gdbarch, regnum))
     return i386_word_names[regnum - tdep->ax_regnum];
 
-  internal_error (__FILE__, __LINE__, _("invalid regnum"));
+  internal_error (_("invalid regnum"));
 }
 
 /* Convert a dbx register number REG to the appropriate register
@@ -2906,8 +2906,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
 	  memcpy (valbuf + low_size, buf, len - low_size);
 	}
       else
-	internal_error (__FILE__, __LINE__,
-			_("Cannot extract return value of %d bytes long."),
+	internal_error (_("Cannot extract return value of %d bytes long."),
 			len);
     }
 }
@@ -2971,8 +2970,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
 				    valbuf + low_size);
 	}
       else
-	internal_error (__FILE__, __LINE__,
-			_("Cannot store return value of %d bytes long."), len);
+	internal_error (_("Cannot store return value of %d bytes long."), len);
     }
 }
 \f
@@ -3337,7 +3335,7 @@ i386_pseudo_register_type (struct gdbarch *gdbarch, int regnum)
 	return bt->builtin_int64;
     }
 
-  internal_error (__FILE__, __LINE__, _("invalid regnum"));
+  internal_error (_("invalid regnum"));
 }
 
 /* Map a cooked register onto a raw register or memory.  For the i386,
@@ -3539,7 +3537,7 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
 	    memcpy (buf, raw_buf, 1);
 	}
       else
-	internal_error (__FILE__, __LINE__, _("invalid regnum"));
+	internal_error (_("invalid regnum"));
     }
 }
 
@@ -3676,7 +3674,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
 	  regcache->raw_write (gpnum % 4, raw_buf);
 	}
       else
-	internal_error (__FILE__, __LINE__, _("invalid regnum"));
+	internal_error (_("invalid regnum"));
     }
 }
 
@@ -3758,7 +3756,7 @@ i386_ax_pseudo_register_collect (struct gdbarch *gdbarch,
       return 0;
     }
   else
-    internal_error (__FILE__, __LINE__, _("invalid regnum"));
+    internal_error (_("invalid regnum"));
   return 1;
 }
 \f
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index a3c642b2643..6b9baf5a10e 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -1410,7 +1410,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
 	   || regnum == I387_MXCSR_REGNUM (tdep))
     regclass = x87_ctrl_or_mxcsr;
   else
-    internal_error (__FILE__, __LINE__, _("invalid i387 regnum %d"), regnum);
+    internal_error (_("invalid i387 regnum %d"), regnum);
 
   if (gcore)
     {
@@ -1683,8 +1683,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
       switch (regclass)
 	{
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  _("invalid i387 regclass"));
+	  internal_error (_("invalid i387 regclass"));
 
 	case pkeys:
 	  /* This is a PKEYS register.  */
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 281c5f13ae9..d7b456b11df 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -713,8 +713,7 @@ ia64_memory_insert_breakpoint (struct gdbarch *gdbarch,
      a single instance by update_global_location_list.  */
   instr_breakpoint = slotN_contents (bundle, slotnum);
   if (instr_breakpoint == IA64_BREAKPOINT)
-    internal_error (__FILE__, __LINE__,
-		    _("Address %s already contains a breakpoint."),
+    internal_error (_("Address %s already contains a breakpoint."),
 		    paddress (gdbarch, bp_tgt->placed_address));
   replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum);
 
diff --git a/gdb/infcall.c b/gdb/infcall.c
index e2de045d7b7..c1db3e22189 100644
--- a/gdb/infcall.c
+++ b/gdb/infcall.c
@@ -1061,7 +1061,7 @@ call_function_by_hand_dummy (struct value *function,
 	break;
       }
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
 
   /* Coerce the arguments and handle pass-by-reference.
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index d729732c81c..c03ca103c91 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1499,7 +1499,7 @@ get_return_value (struct symbol *func_symbol, struct value *function)
       value = NULL;
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
 
   return value;
@@ -1628,8 +1628,7 @@ finish_command_fsm::should_stop (struct thread_info *tp)
 
       rv->type = function->type ()->target_type ();
       if (rv->type == NULL)
-	internal_error (__FILE__, __LINE__,
-			_("finish_command: function has no target type"));
+	internal_error (_("finish_command: function has no target type"));
 
       if (check_typedef (rv->type)->code () != TYPE_CODE_VOID)
 	{
diff --git a/gdb/infrun.c b/gdb/infrun.c
index cdfe02393f5..2e462be5ba7 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -847,8 +847,7 @@ follow_fork ()
       /* Nothing to follow.  */
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      "Unexpected pending_follow.kind %d\n",
+      internal_error ("Unexpected pending_follow.kind %d\n",
 		      tp->pending_follow.kind ());
       break;
     }
@@ -2007,8 +2006,7 @@ start_step_over (void)
 	  || tp->resumed ()
 	  || tp->executing ())
 	{
-	  internal_error (__FILE__, __LINE__,
-			  "[%s] has inconsistent state: "
+	  internal_error ("[%s] has inconsistent state: "
 			  "trap_expected=%d, resumed=%d, executing=%d\n",
 			  tp->ptid.to_string ().c_str (),
 			  tp->control.trap_expected,
@@ -5515,8 +5513,7 @@ handle_inferior_event (struct execution_control_state *ecs)
 	    return;
 	  }
 
-	internal_error (__FILE__, __LINE__,
-			_("unhandled stop_soon: %d"), (int) stop_soon);
+	internal_error (_("unhandled stop_soon: %d"), (int) stop_soon);
       }
 
     case TARGET_WAITKIND_SPURIOUS:
@@ -5967,8 +5964,7 @@ restart_threads (struct thread_info *event_thread, inferior *inf)
 	 above.  */
       if (thread_still_needs_step_over (tp))
 	{
-	  internal_error (__FILE__, __LINE__,
-			  "thread [%s] needs a step-over, but not in "
+	  internal_error ("thread [%s] needs a step-over, but not in "
 			  "step-over queue\n",
 			  tp->ptid.to_string ().c_str ());
 	}
@@ -8492,7 +8488,7 @@ print_stop_location (const target_waitstatus &ws)
       do_frame_printing = 0;
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("Unknown value."));
+      internal_error (_("Unknown value."));
     }
 
   /* The behavior of this routine with respect to the source
@@ -9523,8 +9519,7 @@ show_exec_direction_func (struct ui_file *out, int from_tty,
     gdb_printf (out, _("Reverse.\n"));
     break;
   default:
-    internal_error (__FILE__, __LINE__,
-		    _("bogus execution_direction value: %d"),
+    internal_error (_("bogus execution_direction value: %d"),
 		    (int) execution_direction);
   }
 }
diff --git a/gdb/interps.c b/gdb/interps.c
index 3a9c590b8c8..a8bd67258e4 100644
--- a/gdb/interps.c
+++ b/gdb/interps.c
@@ -115,8 +115,7 @@ interp_factory_register (const char *name, interp_factory_func func)
   for (const interp_factory &f : interpreter_factories)
     if (strcmp (f.name, name) == 0)
       {
-	internal_error (__FILE__, __LINE__,
-			_("interpreter factory already registered: \"%s\"\n"),
+	internal_error (_("interpreter factory already registered: \"%s\"\n"),
 			name);
       }
 
diff --git a/gdb/language.c b/gdb/language.c
index 076e429ff55..3962ee8fa24 100644
--- a/gdb/language.c
+++ b/gdb/language.c
@@ -189,8 +189,7 @@ set_language_command (const char *ignore,
 	}
     }
 
-  internal_error (__FILE__, __LINE__,
-		  "Couldn't find language `%s' in known languages list.",
+  internal_error ("Couldn't find language `%s' in known languages list.",
 		  language);
 }
 
@@ -216,8 +215,7 @@ show_range_command (struct ui_file *file, int from_tty,
 	  tmp = "warn";
 	  break;
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  "Unrecognized range check setting.");
+	  internal_error ("Unrecognized range check setting.");
 	}
 
       gdb_printf (file,
@@ -263,8 +261,7 @@ set_range_command (const char *ignore,
     }
   else
     {
-      internal_error (__FILE__, __LINE__,
-		      _("Unrecognized range check setting: \"%s\""), range);
+      internal_error (_("Unrecognized range check setting: \"%s\""), range);
     }
   if (range_check == range_check_warn
       || ((range_check == range_check_on)
@@ -292,8 +289,7 @@ show_case_command (struct ui_file *file, int from_tty,
 	  tmp = "off";
 	  break;
 	default:
-	  internal_error (__FILE__, __LINE__,
-			  "Unrecognized case-sensitive setting.");
+	  internal_error ("Unrecognized case-sensitive setting.");
 	}
 
       gdb_printf (file,
@@ -334,8 +330,7 @@ set_case_command (const char *ignore, int from_tty, struct cmd_list_element *c)
      }
    else
      {
-       internal_error (__FILE__, __LINE__,
-		       "Unrecognized case-sensitive setting: \"%s\"",
+       internal_error ("Unrecognized case-sensitive setting: \"%s\"",
 		       case_sensitive);
      }
 
@@ -418,7 +413,7 @@ range_error (const char *string,...)
       gdb_printf (gdb_stderr, "\n");
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
   va_end (args);
 }
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index d4639766088..f4f7aa81845 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1116,8 +1116,7 @@ linux_nat_target::attach (const char *args, int from_tty)
 		 gdb_signal_to_string (signo));
 	}
 
-      internal_error (__FILE__, __LINE__,
-		      _("unexpected status %d for PID %ld"),
+      internal_error (_("unexpected status %d for PID %ld"),
 		      status, (long) ptid.lwp ());
     }
 
@@ -1844,11 +1843,9 @@ linux_handle_extended_wait (struct lwp_info *lp, int status)
 	  if (ret == -1)
 	    perror_with_name (_("waiting for new child"));
 	  else if (ret != new_pid)
-	    internal_error (__FILE__, __LINE__,
-			    _("wait returned unexpected PID %d"), ret);
+	    internal_error (_("wait returned unexpected PID %d"), ret);
 	  else if (!WIFSTOPPED (status))
-	    internal_error (__FILE__, __LINE__,
-			    _("wait returned unexpected status 0x%x"), status);
+	    internal_error (_("wait returned unexpected status 0x%x"), status);
 	}
 
       ptid_t child_ptid (new_pid, new_pid);
@@ -1989,8 +1986,7 @@ linux_handle_extended_wait (struct lwp_info *lp, int status)
 	return 0;
     }
 
-  internal_error (__FILE__, __LINE__,
-		  _("unknown ptrace event %d"), event);
+  internal_error (_("unknown ptrace event %d"), event);
 }
 
 /* Suspend waiting for a signal.  We're mostly interested in
@@ -4231,7 +4227,7 @@ linux_nat_target::async (bool enable)
   if (enable)
     {
       if (!async_file_open ())
-	internal_error (__FILE__, __LINE__, "creating event pipe failed.");
+	internal_error ("creating event pipe failed.");
 
       add_file_handler (async_wait_fd (), handle_target_event, NULL,
 			"linux-nat");
diff --git a/gdb/loongarch-tdep.c b/gdb/loongarch-tdep.c
index 8f72dd2c173..d727bc85062 100644
--- a/gdb/loongarch-tdep.c
+++ b/gdb/loongarch-tdep.c
@@ -1394,8 +1394,7 @@ loongarch_features_from_bfd (const bfd *abfd)
       else if (eclass == ELFCLASS64)
 	features.xlen = 8;
       else
-	internal_error (__FILE__, __LINE__,
-			_("unknown ELF header class %d"), eclass);
+	internal_error (_("unknown ELF header class %d"), eclass);
 
       if (EF_LOONGARCH_IS_SINGLE_FLOAT (e_flags))
 	features.fputype = SINGLE_FLOAT;
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 9b839c754dd..f5101635aed 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -2558,8 +2558,7 @@ m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
   m32c_gdbarch_tdep *tdep = gdbarch_tdep<m32c_gdbarch_tdep> (gdbarch);
   
   if (!find_pc_partial_function (pc, &name, &func_addr, &func_end))
-    internal_error (__FILE__, __LINE__,
-		    _("No virtual frame pointer available"));
+    internal_error (_("No virtual frame pointer available"));
 
   m32c_analyze_prologue (gdbarch, func_addr, pc, &p);
   switch (p.kind)
@@ -2579,8 +2578,7 @@ m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc,
     }
   /* Sanity check */
   if (*frame_regnum > gdbarch_num_regs (gdbarch))
-    internal_error (__FILE__, __LINE__,
-		    _("No virtual frame pointer available"));
+    internal_error (_("No virtual frame pointer available"));
 }
 
 \f
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 502020dd1e0..47e879f0b61 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -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 ();
diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c
index 3c8392f7ced..c449b8efe91 100644
--- a/gdb/m68k-linux-nat.c
+++ b/gdb/m68k-linux-nat.c
@@ -445,8 +445,7 @@ m68k_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,
@@ -489,8 +488,7 @@ m68k_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);
 }
 \f
 
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 002c7e0742f..c0a33118814 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -312,8 +312,7 @@ m68k_extract_return_value (struct type *type, struct regcache *regcache,
       regcache->raw_read (M68K_D1_REGNUM, valbuf + (len - 4));
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("Cannot extract return value of %d bytes long."), len);
+    internal_error (_("Cannot extract return value of %d bytes long."), len);
 }
 
 static void
@@ -359,8 +358,7 @@ m68k_store_return_value (struct type *type, struct regcache *regcache,
       regcache->raw_write (M68K_D1_REGNUM, valbuf + (len - 4));
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("Cannot store return value of %d bytes long."), len);
+    internal_error (_("Cannot store return value of %d bytes long."), len);
 }
 
 static void
@@ -1060,8 +1058,7 @@ m68k_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc)
 
   if (tdep->jb_pc < 0)
     {
-      internal_error (__FILE__, __LINE__,
-		      _("m68k_get_longjmp_target: not implemented"));
+      internal_error (_("m68k_get_longjmp_target: not implemented"));
       return 0;
     }
 
diff --git a/gdb/macroexp.c b/gdb/macroexp.c
index be5723fe600..6bd5ef513fd 100644
--- a/gdb/macroexp.c
+++ b/gdb/macroexp.c
@@ -632,8 +632,7 @@ append_tokens_without_splicing (growable_macro_buffer *dest,
 
   /* As far as I know, there's no case where inserting a space isn't
      enough to prevent a splice.  */
-  internal_error (__FILE__, __LINE__,
-		  _("unable to avoid splicing tokens during macro expansion"));
+  internal_error (_("unable to avoid splicing tokens during macro expansion"));
 }
 
 /* Stringify an argument, and insert it into DEST.  ARG is the text to
@@ -1311,7 +1310,7 @@ expand (const char *id,
       return 1;
     }
   else
-    internal_error (__FILE__, __LINE__, _("bad macro definition kind"));
+    internal_error (_("bad macro definition kind"));
 }
 
 
diff --git a/gdb/maint.c b/gdb/maint.c
index 76ac7bece38..c3241b22268 100644
--- a/gdb/maint.c
+++ b/gdb/maint.c
@@ -76,7 +76,7 @@ maintenance_dump_me (const char *args, int from_tty)
 static void
 maintenance_internal_error (const char *args, int from_tty)
 {
-  internal_error (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
+  internal_error ("%s", (args == NULL ? "" : args));
 }
 
 /* Stimulate the internal error mechanism that GDB uses when an
@@ -87,7 +87,7 @@ maintenance_internal_error (const char *args, int from_tty)
 static void
 maintenance_internal_warning (const char *args, int from_tty)
 {
-  internal_warning (__FILE__, __LINE__, "%s", (args == NULL ? "" : args));
+  internal_warning ("%s", (args == NULL ? "" : args));
 }
 
 /* Stimulate the internal error mechanism that GDB uses when an
diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c
index 78688d58b40..f0af7c9a014 100644
--- a/gdb/mi/mi-cmd-stack.c
+++ b/gdb/mi/mi-cmd-stack.c
@@ -591,8 +591,7 @@ list_args_or_locals (const frame_print_options &fp_opts,
       name_of_result = "variables";
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      "unexpected what_to_list: %d", (int) what);
+      internal_error ("unexpected what_to_list: %d", (int) what);
     }
 
   ui_out_emit_list list_emitter (uiout, name_of_result);
diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
index 8c0821691bf..50c53a0b389 100644
--- a/gdb/mi/mi-getopt.c
+++ b/gdb/mi/mi-getopt.c
@@ -33,8 +33,7 @@ mi_getopt_1 (const char *prefix, int argc, char **argv,
 
   /* We assume that argv/argc are ok.  */
   if (*oind > argc || *oind < 0)
-    internal_error (__FILE__, __LINE__,
-		    _("mi_getopt_long: oind out of bounds"));
+    internal_error (_("mi_getopt_long: oind out of bounds"));
   if (*oind == argc)
     return -1;
   arg = argv[*oind];
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index 96a847eb6b6..028c0058e58 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -225,7 +225,7 @@ mi_ui_out::open (const char *name, ui_out_type type)
       break;
 
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
 }
 
@@ -245,7 +245,7 @@ mi_ui_out::close (ui_out_type type)
       break;
 
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
 
   m_suppress_field_separator = false;
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 7ed7116de76..efa1daaa7fc 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -533,8 +533,7 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
 	memcpy (valbuf, buf, type->length ());
 	return;
       default:
-	internal_error (__FILE__, __LINE__, 
-			_("Unsupported return value size requested"));
+	internal_error (_("Unsupported return value size requested"));
     }
 }
 
diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 0da615564b6..3b65669d176 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -1021,8 +1021,7 @@ stub_gnu_ifunc_resolve_name (const char *function_name,
 static void
 stub_gnu_ifunc_resolver_stop (code_breakpoint *b)
 {
-  internal_error (__FILE__, __LINE__,
-		  _("elf_gnu_ifunc_resolver_stop cannot be reached."));
+  internal_error (_("elf_gnu_ifunc_resolver_stop cannot be reached."));
 }
 
 /* See elf_gnu_ifunc_resolver_return_stop for its real implementation.  */
@@ -1030,8 +1029,7 @@ stub_gnu_ifunc_resolver_stop (code_breakpoint *b)
 static void
 stub_gnu_ifunc_resolver_return_stop (code_breakpoint *b)
 {
-  internal_error (__FILE__, __LINE__,
-		  _("elf_gnu_ifunc_resolver_return_stop cannot be reached."));
+  internal_error (_("elf_gnu_ifunc_resolver_return_stop cannot be reached."));
 }
 
 /* See elf_gnu_ifunc_fns for its real implementation.  */
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index a5c39ce224f..72bf8fd660d 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -321,7 +321,7 @@ mips_abi_regsize (struct gdbarch *gdbarch)
     case MIPS_ABI_UNKNOWN:
     case MIPS_ABI_LAST:
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
 }
 
@@ -527,7 +527,7 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
       reg_offset = 0;
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
   if (mips_debug)
     gdb_printf (gdb_stderr,
@@ -690,8 +690,7 @@ mips_register_name (struct gdbarch *gdbarch, int regno)
       return "";
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("mips_register_name: bad register number %d"), rawnum);
+    internal_error (_("mips_register_name: bad register number %d"), rawnum);
 }
 
 /* Return the groups that a MIPS register can be categorised into.  */
@@ -793,7 +792,7 @@ mips_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache,
 	}
     }
   else
-    internal_error (__FILE__, __LINE__, _("bad register size"));
+    internal_error (_("bad register size"));
 }
 
 static void
@@ -824,7 +823,7 @@ mips_pseudo_register_write (struct gdbarch *gdbarch,
 	}
     }
   else
-    internal_error (__FILE__, __LINE__, _("bad register size"));
+    internal_error (_("bad register size"));
 }
 
 static int
@@ -867,7 +866,7 @@ mips_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
 	}
     }
   else
-    internal_error (__FILE__, __LINE__, _("bad register size"));
+    internal_error (_("bad register size"));
 
   return 0;
 }
@@ -977,8 +976,7 @@ mips_register_to_value (frame_info_ptr frame, int regnum,
     }
   else
     {
-      internal_error (__FILE__, __LINE__,
-		      _("mips_register_to_value: unrecognized case"));
+      internal_error (_("mips_register_to_value: unrecognized case"));
     }
 }
 
@@ -1025,8 +1023,7 @@ mips_value_to_register (frame_info_ptr frame, int regnum,
     }
   else
     {
-      internal_error (__FILE__, __LINE__,
-		      _("mips_value_to_register: unrecognized case"));
+      internal_error (_("mips_value_to_register: unrecognized case"));
     }
 }
 
@@ -1172,8 +1169,7 @@ mips_mask_address_p (mips_gdbarch_tdep *tdep)
     case AUTO_BOOLEAN_AUTO:
       return tdep->default_mask_address_p;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("mips_mask_address_p: bad switch"));
+      internal_error (_("mips_mask_address_p: bad switch"));
       return -1;
     }
 }
@@ -1482,7 +1478,7 @@ mips_fetch_instruction (struct gdbarch *gdbarch,
       instlen = MIPS_INSN32_SIZE;
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("invalid ISA"));
+      internal_error (_("invalid ISA"));
       break;
     }
   err = target_read_memory (addr, buf, instlen);
@@ -1566,7 +1562,7 @@ mips_insn_size (enum mips_isa isa, ULONGEST insn)
     case ISA_MIPS:
 	return MIPS_INSN32_SIZE;
     }
-  internal_error (__FILE__, __LINE__, _("invalid ISA"));
+  internal_error (_("invalid ISA"));
 }
 
 static LONGEST
@@ -2258,7 +2254,7 @@ unpack_mips16 (struct gdbarch *gdbarch, CORE_ADDR pc,
 	break;
       }
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
   upk->offset = offset;
   upk->regx = regx;
@@ -5805,7 +5801,7 @@ mips_o32_return_value (struct gdbarch *gdbarch, struct value *function,
 				  readbuf, writebuf, 4);
 	      break;
 	    default:
-	      internal_error (__FILE__, __LINE__, _("bad switch"));
+	      internal_error (_("bad switch"));
 	    }
 	}
       if (fval_reg != mips_fval_fpr)
@@ -6306,8 +6302,7 @@ mips_read_fp_register_double (frame_info_ptr frame, int regno,
       int rawnum = regno % gdbarch_num_regs (gdbarch);
 
       if ((rawnum - mips_regnum (gdbarch)->fp0) & 1)
-	internal_error (__FILE__, __LINE__,
-			_("mips_read_fp_register_double: bad access to "
+	internal_error (_("mips_read_fp_register_double: bad access to "
 			"odd-numbered FP register"));
 
       /* mips_read_fp_register_single will find the correct 32 bits from
@@ -6949,7 +6944,7 @@ show_mipsfpu_command (const char *args, int from_tty)
       fpu = "absent (none)";
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
   if (mips_fpu_type_auto)
     gdb_printf ("The MIPS floating-point coprocessor "
@@ -6971,7 +6966,7 @@ set_mipsfpu_single_command (const char *args, int from_tty)
      instead of relying on globals.  Doing that would let generic code
      handle the search for this specific architecture.  */
   if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, _("set mipsfpu failed"));
+    internal_error (_("set mipsfpu failed"));
 }
 
 static void
@@ -6984,7 +6979,7 @@ set_mipsfpu_double_command (const char *args, int from_tty)
      instead of relying on globals.  Doing that would let generic code
      handle the search for this specific architecture.  */
   if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, _("set mipsfpu failed"));
+    internal_error (_("set mipsfpu failed"));
 }
 
 static void
@@ -6997,7 +6992,7 @@ set_mipsfpu_none_command (const char *args, int from_tty)
      instead of relying on globals.  Doing that would let generic code
      handle the search for this specific architecture.  */
   if (!gdbarch_update_p (info))
-    internal_error (__FILE__, __LINE__, _("set mipsfpu failed"));
+    internal_error (_("set mipsfpu failed"));
 }
 
 static void
@@ -8033,7 +8028,7 @@ global_mips_abi (void)
     if (mips_abi_strings[i] == mips_abi_string)
       return (enum mips_abi) i;
 
-  internal_error (__FILE__, __LINE__, _("unknown ABI string"));
+  internal_error (_("unknown ABI string"));
 }
 
 /* Return the default compressed instruction set, either of MIPS16
@@ -8050,7 +8045,7 @@ global_mips_compression (void)
     if (mips_compression_strings[i] == mips_compression_string)
       return (enum mips_isa) i;
 
-  internal_error (__FILE__, __LINE__, _("unknown compressed ISA string"));
+  internal_error (_("unknown compressed ISA string"));
 }
 
 static void
@@ -8604,7 +8599,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
       set_gdbarch_long_double_format (gdbarch, floatformats_ibm_long_double);
       break;
     default:
-      internal_error (__FILE__, __LINE__, _("unknown ABI in switch"));
+      internal_error (_("unknown ABI in switch"));
     }
 
   /* GCC creates a pseudo-section whose name specifies the size of
@@ -8653,7 +8648,7 @@ mips_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 	      set_gdbarch_ptr_bit (gdbarch, long_bit);
 	      break;
 	    default:
-	      internal_error (__FILE__, __LINE__, _("unknown ABI in switch"));
+	      internal_error (_("unknown ABI in switch"));
 	    }
 	}
     }
@@ -8980,7 +8975,7 @@ _initialize_mips_tdep ()
   mips_abi_string = mips_abi_strings[MIPS_ABI_UNKNOWN];
   if (MIPS_ABI_LAST + 1
       != sizeof (mips_abi_strings) / sizeof (mips_abi_strings[0]))
-    internal_error (__FILE__, __LINE__, _("mips_abi_strings out of sync"));
+    internal_error (_("mips_abi_strings out of sync"));
 
   gdbarch_register (bfd_arch_mips, mips_gdbarch_init, mips_dump_tdep);
 
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 5be02132a5d..815949c67ae 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -124,7 +124,7 @@ mn10300_type_align (struct type *type)
       return mn10300_type_align (check_typedef (type));
 
     default:
-      internal_error (__FILE__, __LINE__, _("bad switch"));
+      internal_error (_("bad switch"));
     }
 }
 
@@ -190,8 +190,7 @@ mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type,
       regcache->raw_write_part (reg + 1, 0, len - regsz, valbuf + regsz);
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("Cannot store return value %d bytes long."), len);
+    internal_error (_("Cannot store return value %d bytes long."), len);
 }
 
 static void
@@ -223,8 +222,7 @@ mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
       memcpy ((char *) valbuf + regsz, buf, len - regsz);
     }
   else
-    internal_error (__FILE__, __LINE__,
-		    _("Cannot extract return value %d bytes long."), len);
+    internal_error (_("Cannot extract return value %d bytes long."), len);
 }
 
 /* Determine, for architecture GDBARCH, how a return value of TYPE
@@ -1364,8 +1362,7 @@ mn10300_gdbarch_init (struct gdbarch_info info,
       set_gdbarch_fp0_regnum (gdbarch, 32);
       break;
     default:
-      internal_error (__FILE__, __LINE__,
-		      _("mn10300_gdbarch_init: Unknown mn10300 variant"));
+      internal_error (_("mn10300_gdbarch_init: Unknown mn10300 variant"));
       break;
     }
 
diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c
index 77868f78bd3..54554247230 100644
--- a/gdb/msp430-tdep.c
+++ b/gdb/msp430-tdep.c
@@ -865,8 +865,7 @@ msp430_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
 	    code_model = MSP_LARGE_CODE_MODEL;
 	    break;
 	  default:
-	    internal_error (__FILE__, __LINE__,
-			    _("Unknown msp430x code memory model"));
+	    internal_error (_("Unknown msp430x code memory model"));
 	    break;
 	  }
 	break;
diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
index c31fb5ffe43..4911630ba5c 100644
--- a/gdb/nat/linux-btrace.c
+++ b/gdb/nat/linux-btrace.c
@@ -912,7 +912,7 @@ linux_read_pt (struct btrace_data_pt *btrace,
       return BTRACE_ERR_NONE;
     }
 
-  internal_error (__FILE__, __LINE__, _("Unknown btrace read type."));
+  internal_error (_("Unknown btrace read type."));
 }
 
 /* See linux-btrace.h.  */
@@ -943,7 +943,7 @@ linux_read_btrace (struct btrace_data *btrace,
       return linux_read_pt (&btrace->varian[...]

[diff truncated at 100000 bytes]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-19 14:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-19 14:46 [binutils-gdb] internal_error: remove need to pass __FILE__/__LINE__ Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).