From 8e65ff28b0780a52bdbe067b6297a66f9ec4e16e Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Thu, 8 Feb 2001 06:03:54 +0000 Subject: [PATCH] Add __FILE__ and __LINE__ parameter to internal_error() / internal_verror(). --- gdb/ChangeLog | 58 ++++++ gdb/TODO | 4 - gdb/a29k-tdep.c | 5 +- gdb/arch-utils.c | 47 +++-- gdb/ax-gdb.c | 32 ++-- gdb/breakpoint.c | 18 +- gdb/ch-exp.c | 14 +- gdb/cli/cli-script.c | 9 +- gdb/cli/cli-setshow.c | 8 +- gdb/d10v-tdep.c | 8 +- gdb/d30v-tdep.c | 5 +- gdb/defs.h | 6 +- gdb/dsrec.c | 5 +- gdb/dwarf2read.c | 15 +- gdb/elfread.c | 9 +- gdb/event-loop.c | 24 ++- gdb/f-lang.c | 5 +- gdb/findvar.c | 14 +- gdb/gdb_assert.h | 5 +- gdb/gdbarch.c | 429 ++++++++++++++++++++++++++++-------------- gdb/gdbarch.h | 30 +-- gdb/gdbarch.sh | 37 ++-- gdb/go32-nat.c | 16 +- gdb/hppah-nat.c | 9 +- gdb/i386-linux-nat.c | 8 +- gdb/i386-tdep.c | 8 +- gdb/ia64-tdep.c | 21 ++- gdb/infcmd.c | 6 +- gdb/inferior.h | 18 +- gdb/infptrace.c | 3 +- gdb/infrun.c | 11 +- gdb/language.c | 5 +- gdb/m3-nat.c | 18 +- gdb/m68k-tdep.c | 5 +- gdb/maint.c | 5 +- gdb/mi/ChangeLog | 8 + gdb/mi/mi-cmd-break.c | 5 +- gdb/mi/mi-cmds.c | 3 +- gdb/mi/mi-console.c | 12 +- gdb/mi/mi-getopt.c | 3 +- gdb/mips-tdep.c | 9 +- gdb/mn10300-tdep.c | 6 +- gdb/objfiles.c | 6 +- gdb/objfiles.h | 18 +- gdb/regcache.c | 20 +- gdb/remote-mips.c | 6 +- gdb/remote-sim.c | 6 +- gdb/remote-vx.c | 3 +- gdb/remote.c | 36 ++-- gdb/rs6000-nat.c | 6 +- gdb/rs6000-tdep.c | 8 +- gdb/serial.c | 6 +- gdb/sh-tdep.c | 6 +- gdb/solib-svr4.c | 5 +- gdb/solib.c | 5 +- gdb/source.c | 4 +- gdb/sparc-tdep.c | 6 +- gdb/symm-nat.c | 18 +- gdb/symtab.h | 5 +- gdb/target.h | 2 +- gdb/tui/ChangeLog | 5 + gdb/tui/tui-file.c | 23 ++- gdb/ui-file.c | 32 ++-- gdb/ui-out.c | 38 ++-- gdb/utils.c | 34 ++-- gdb/v850-tdep.c | 5 +- 66 files changed, 839 insertions(+), 430 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a460d56eed..62b0330236 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,61 @@ +Wed Feb 7 19:41:21 2001 Andrew Cagney + + * defs.h (internal_error, internal_verror): Add __FILE__ and + __LINE__ parameter. + * utils.c (internal_error, internal_verror): Update. + + * v850-tdep.c: Update calls to internal_error. + * utils.c: Ditto. + * ui-out.c: Ditto. + * ui-file.c: Ditto. + * target.h: Ditto. + * symtab.h: Ditto. + * symm-nat.c: Ditto. + * sparc-tdep.c: Ditto. + * source.c: Ditto. + * serial.c: Ditto. + * rs6000-tdep.c: Ditto. + * rs6000-nat.c: Ditto. + * remote.c: Ditto. + * remote-vx.c: Ditto. + * remote-sim.c: Ditto. + * remote-mips.c: Ditto. + * regcache.c: Ditto. + * objfiles.h: Ditto. + * objfiles.c: Ditto. + * mn10300-tdep.c: Ditto. + * mips-tdep.c: Ditto. + * maint.c: Ditto. + * m68k-tdep.c: Ditto. + * m3-nat.c: Ditto. + * language.c: Ditto. + * infptrace.c: Ditto. + * inferior.h: Ditto. + * infcmd.c: Ditto. + * ia64-tdep.c: Ditto. + * i386-tdep.c: Ditto. + * i386-linux-nat.c: Ditto. + * hppah-nat.c: Ditto. + * go32-nat.c: Ditto. + * findvar.c: Ditto. + * f-lang.c: Ditto. + * elfread.c: Ditto. + * event-loop.c: Ditto. + * dwarf2read.c: Ditto. + * dsrec.c: Ditto. + * d30v-tdep.c: Ditto. + * d10v-tdep.c: Ditto. + * cli/cli-setshow.c: Ditto. + * cli/cli-script.c: Ditto. + * ch-exp.c: Ditto. + * breakpoint.c: Ditto. + * ax-gdb.c: Ditto. + * arch-utils.c: Ditto. + * a29k-tdep.c: Ditto. + * gdb_assert.h: Ditto. + * gdbarch.sh: Ditto. + * gdbarch.h, gdbarch.c: Re-generate. + 2001-02-07 Andrew Cagney From Mark Kettenis : diff --git a/gdb/TODO b/gdb/TODO index 9f149a1b9e..83c0c4476a 100644 --- a/gdb/TODO +++ b/gdb/TODO @@ -433,10 +433,6 @@ an error status. -- -Add __LINE__ and __FILE__ to internal_error(). - --- - GDB probably doesn't build on FreeBSD pre 2.2.x http://sourceware.cygnus.com/ml/gdb-patches/2000-05/msg00378.html diff --git a/gdb/a29k-tdep.c b/gdb/a29k-tdep.c index 4d307b7fbb..1a2d929ee8 100644 --- a/gdb/a29k-tdep.c +++ b/gdb/a29k-tdep.c @@ -1,5 +1,5 @@ /* Target-machine dependent code for the AMD 29000 - Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Jim Kingdon. @@ -892,7 +892,8 @@ setup_arbitrary_frame (int argc, CORE_ADDR *argv) frame = create_new_frame (argv[0], argv[1]); if (!frame) - internal_error ("create_new_frame returned invalid frame id"); + internal_error (__FILE__, __LINE__, + "create_new_frame returned invalid frame id"); /* Creating a new frame munges the `frame' value from the current GR1, so we restore it again here. FIXME, untangle all this diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 00aad2f7e2..f5369f780f 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -1,5 +1,5 @@ /* Dynamic architecture support for GDB, the GNU debugger. - Copyright 1998-1999, Free Software Foundation, Inc. + Copyright 1998-1999, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -117,7 +117,8 @@ legacy_register_name (int i) else return names[i]; #else - internal_error ("legacy_register_name: called."); + internal_error (__FILE__, __LINE__, + "legacy_register_name: called."); return NULL; #endif } @@ -180,7 +181,8 @@ default_float_format (struct gdbarch *gdbarch) case LITTLE_ENDIAN: return &floatformat_ieee_single_little; default: - internal_error ("default_float_format: bad byte order"); + internal_error (__FILE__, __LINE__, + "default_float_format: bad byte order"); } } @@ -200,7 +202,8 @@ default_double_format (struct gdbarch *gdbarch) case LITTLE_ENDIAN: return &floatformat_ieee_double_little; default: - internal_error ("default_double_format: bad byte order"); + internal_error (__FILE__, __LINE__, + "default_double_format: bad byte order"); } } @@ -347,7 +350,8 @@ set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c) } } else - internal_error ("set_endian: bad value"); + internal_error (__FILE__, __LINE__, + "set_endian: bad value"); show_endian (NULL, from_tty); } @@ -357,7 +361,8 @@ static void set_endian_from_file (bfd *abfd) { if (GDB_MULTI_ARCH) - internal_error ("set_endian_from_file: not for multi-arch"); + internal_error (__FILE__, __LINE__, + "set_endian_from_file: not for multi-arch"); if (TARGET_BYTE_ORDER_SELECTABLE_P) { int want; @@ -403,7 +408,8 @@ static int arch_ok (const struct bfd_arch_info *arch) { if (GDB_MULTI_ARCH) - internal_error ("arch_ok: not multi-arched"); + internal_error (__FILE__, __LINE__, + "arch_ok: not multi-arched"); /* Should be performing the more basic check that the binary is compatible with GDB. */ /* Check with the target that the architecture is valid. */ @@ -416,7 +422,8 @@ set_arch (const struct bfd_arch_info *arch, enum set_arch type) { if (GDB_MULTI_ARCH) - internal_error ("set_arch: not multi-arched"); + internal_error (__FILE__, __LINE__, + "set_arch: not multi-arched"); switch (type) { case set_arch_auto: @@ -450,11 +457,13 @@ set_architecture_from_arch_mach (enum bfd_architecture arch, { const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach); if (GDB_MULTI_ARCH) - internal_error ("set_architecture_from_arch_mach: not multi-arched"); + internal_error (__FILE__, __LINE__, + "set_architecture_from_arch_mach: not multi-arched"); if (wanted != NULL) set_arch (wanted, set_arch_manual); else - internal_error ("gdbarch: hardwired architecture/machine not recognized"); + internal_error (__FILE__, __LINE__, + "gdbarch: hardwired architecture/machine not recognized"); } /* Set the architecture from a BFD (deprecated) */ @@ -464,7 +473,8 @@ set_architecture_from_file (bfd *abfd) { const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd); if (GDB_MULTI_ARCH) - internal_error ("set_architecture_from_file: not multi-arched"); + internal_error (__FILE__, __LINE__, + "set_architecture_from_file: not multi-arched"); if (target_architecture_auto) { set_arch (wanted, set_arch_auto); @@ -509,7 +519,8 @@ set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c) memset (&info, 0, sizeof info); info.bfd_arch_info = bfd_scan_arch (set_architecture_string); if (info.bfd_arch_info == NULL) - internal_error ("set_architecture: bfd_scan_arch failed"); + internal_error (__FILE__, __LINE__, + "set_architecture: bfd_scan_arch failed"); if (gdbarch_update_p (info)) target_architecture_auto = 0; else @@ -521,7 +532,8 @@ set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c) const struct bfd_arch_info *arch = bfd_scan_arch (set_architecture_string); if (arch == NULL) - internal_error ("set_architecture: bfd_scan_arch failed"); + internal_error (__FILE__, __LINE__, + "set_architecture: bfd_scan_arch failed"); set_arch (arch, set_arch_manual); } show_architecture (NULL, from_tty); @@ -625,10 +637,12 @@ initialize_current_architecture (void) chosen = *arch; } if (chosen == NULL) - internal_error ("initialize_current_architecture: No arch"); + internal_error (__FILE__, __LINE__, + "initialize_current_architecture: No arch"); info.bfd_arch_info = bfd_scan_arch (chosen); if (info.bfd_arch_info == NULL) - internal_error ("initialize_current_architecture: Arch not found"); + internal_error (__FILE__, __LINE__, + "initialize_current_architecture: Arch not found"); } /* take several guesses at a byte order. */ @@ -670,7 +684,8 @@ initialize_current_architecture (void) { if (! gdbarch_update_p (info)) { - internal_error ("initialize_current_architecture: Selection of initial architecture failed"); + internal_error (__FILE__, __LINE__, + "initialize_current_architecture: Selection of initial architecture failed"); } } diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 1635364b1c..59efe92668 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -1,5 +1,5 @@ /* GDB-specific functions for operating on agent expressions - Copyright 1998, 2000 Free Software Foundation, Inc. + Copyright 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -409,7 +409,8 @@ 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 ("ax-gdb.c (gen_fetch): strange size"); + internal_error (__FILE__, __LINE__, + "gen_fetch: strange size"); } gen_sign_extend (ax, type); @@ -420,7 +421,8 @@ gen_fetch (struct agent_expr *ax, struct type *type) pointer (other code's fault), or we're not implementing something we should be (this code's fault). In any case, it's a bug the user shouldn't see. */ - internal_error ("ax-gdb.c (gen_fetch): bad type code"); + internal_error (__FILE__, __LINE__, + "gen_fetch: bad type code"); } } @@ -530,7 +532,8 @@ gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var) break; case LOC_CONST_BYTES: - internal_error ("ax-gdb.c (gen_var_ref): LOC_CONST_BYTES symbols are not supported"); + internal_error (__FILE__, __LINE__, + "gen_var_ref: LOC_CONST_BYTES symbols are not supported"); /* Variable at a fixed location in memory. Easy. */ case LOC_STATIC: @@ -1088,7 +1091,8 @@ gen_deref (struct agent_expr *ax, 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->code != TYPE_CODE_PTR) - internal_error ("ax-gdb.c (gen_deref): expected a pointer"); + internal_error (__FILE__, __LINE__, + "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 @@ -1143,7 +1147,8 @@ find_field (struct type *type, char *name) /* Make sure this isn't C++. */ if (TYPE_N_BASECLASSES (type) != 0) - internal_error ("ax-gdb.c (find_field): derived classes supported"); + internal_error (__FILE__, __LINE__, + "find_field: derived classes supported"); for (i = 0; i < TYPE_NFIELDS (type); i++) { @@ -1153,7 +1158,8 @@ find_field (struct type *type, char *name) return i; if (this_name[0] == '\0') - internal_error ("ax-gdb.c (find_field): anonymous unions not supported"); + internal_error (__FILE__, __LINE__, + "find_field: anonymous unions not supported"); } error ("Couldn't find member named `%s' in struct/union `%s'", @@ -1225,7 +1231,8 @@ 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 ("ax-gdb.c (gen_bitfield_ref): bitfield too wide"); + internal_error (__FILE__, __LINE__, + "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. */ @@ -1535,7 +1542,8 @@ gen_expr (union exp_element **pc, struct agent_expr *ax, default: /* We should only list operators in the outer case statement that we actually handle in the inner case statement. */ - internal_error ("ax-gdb.c (gen_expr): op case sets don't match"); + internal_error (__FILE__, __LINE__, + "gen_expr: op case sets don't match"); } break; @@ -1610,7 +1618,8 @@ gen_expr (union exp_element **pc, struct agent_expr *ax, the given type, and dereference it. */ if (value->kind != axs_rvalue) /* This would be weird. */ - internal_error ("ax-gdb.c (gen_expr): OP_MEMVAL operand isn't an rvalue???"); + internal_error (__FILE__, __LINE__, + "gen_expr: OP_MEMVAL operand isn't an rvalue???"); value->type = type; value->kind = axs_lvalue_memory; } @@ -1678,7 +1687,8 @@ gen_expr (union exp_element **pc, struct agent_expr *ax, 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 ("ax-gdb.c (gen_expr): unhandled struct case"); + internal_error (__FILE__, __LINE__, + "gen_expr: unhandled struct case"); } break; diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 3dea3044f5..607cae5c42 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2182,7 +2182,8 @@ print_bp_stop_message (bpstat bs) return print_it_typical (bs); break; default: - internal_error ("print_bp_stop_message: unrecognized enum value"); + internal_error (__FILE__, __LINE__, + "print_bp_stop_message: unrecognized enum value"); break; } } @@ -3131,7 +3132,8 @@ print_one_breakpoint (struct breakpoint *b, annotate_field (1); if (((int) b->type > (sizeof (bptypes) / sizeof (bptypes[0]))) || ((int) b->type != bptypes[(int) b->type].type)) - internal_error ("bptypes table does not describe type #%d.", + internal_error (__FILE__, __LINE__, + "bptypes table does not describe type #%d.", (int) b->type); #ifdef UI_OUT ui_out_field_string (uiout, "type", bptypes[(int) b->type].description); @@ -3163,7 +3165,8 @@ print_one_breakpoint (struct breakpoint *b, switch (b->type) { case bp_none: - internal_error ("print_one_breakpoint: bp_none encountered\n"); + internal_error (__FILE__, __LINE__, + "print_one_breakpoint: bp_none encountered\n"); break; case bp_watchpoint: @@ -3750,14 +3753,16 @@ check_duplicates (CORE_ADDR address, asection *section) /* Permanent breakpoint should always be inserted. */ if (! perm_bp->inserted) - internal_error ("allegedly permanent breakpoint is not " + internal_error (__FILE__, __LINE__, + "allegedly permanent breakpoint is not " "actually inserted"); ALL_BREAKPOINTS (b) if (b != perm_bp) { if (b->inserted) - internal_error ("another breakpoint was inserted on top of " + internal_error (__FILE__, __LINE__, + "another breakpoint was inserted on top of " "a permanent breakpoint"); if (b->enable != disabled @@ -6782,7 +6787,8 @@ delete_breakpoint (struct breakpoint *bpt) If there is a permanent breakpoint somewhere, it should always be the only one inserted. */ if (b->enable == permanent) - internal_error ("another breakpoint was inserted on top of " + internal_error (__FILE__, __LINE__, + "another breakpoint was inserted on top of " "a permanent breakpoint"); if (b->type == bp_hardware_breakpoint) diff --git a/gdb/ch-exp.c b/gdb/ch-exp.c index 32eb2ebb31..2054bd354f 100644 --- a/gdb/ch-exp.c +++ b/gdb/ch-exp.c @@ -1,5 +1,5 @@ /* Parser for GNU CHILL (CCITT High-Level Language) -*- C -*- - Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1995, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -216,7 +216,8 @@ static enum ch_terminal peek_token_ (int i) { if (i > MAX_LOOK_AHEAD) - internal_error ("ch-exp.c - too much lookahead"); + internal_error (__FILE__, __LINE__, + "too much lookahead"); if (terminal_buffer[i] == TOKEN_NOT_READ) { terminal_buffer[i] = ch_lex (); @@ -232,7 +233,8 @@ pushback_token (enum ch_terminal code, YYSTYPE node) { int i; if (terminal_buffer[MAX_LOOK_AHEAD] != TOKEN_NOT_READ) - internal_error ("ch-exp.c - cannot pushback token"); + internal_error (__FILE__, __LINE__, + "cannot pushback token"); for (i = MAX_LOOK_AHEAD; i > 0; i--) { terminal_buffer[i] = terminal_buffer[i - 1]; @@ -265,7 +267,8 @@ require (enum ch_terminal token) { if (PEEK_TOKEN () != token) { - internal_error ("ch-exp.c - expected token %d", (int) token); + internal_error (__FILE__, __LINE__, + "expected token %d", (int) token); } FORWARD_TOKEN (); } @@ -2177,7 +2180,8 @@ ch_lex (void) error ("Symbol \"%s\" names no location.", inputname); break; default: - internal_error ("unhandled SYMBOL_CLASS in ch_lex()"); + internal_error (__FILE__, __LINE__, + "unhandled SYMBOL_CLASS in ch_lex()"); break; } } diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index ce4cca4c0a..d946ed2f93 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1,5 +1,5 @@ /* GDB CLI command scripting. - Copyright 1986-2000 Free Software Foundation, Inc. + Copyright 1986-2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -513,7 +513,8 @@ arg_cleanup (void *ignore) { struct user_args *oargs = user_args; if (!user_args) - internal_error ("Internal error, arg_cleanup called with no user args.\n"); + internal_error (__FILE__, __LINE__, + "arg_cleanup called with no user args.\n"); user_args = user_args->next; xfree (oargs); @@ -1169,7 +1170,7 @@ define_command (char *comname, int from_tty) break; default: /* Should never come here as hookc would be 0. */ - internal_error ("%s:%d: bad switch", __FILE__, __LINE__); + internal_error (__FILE__, __LINE__, "bad switch"); } } } @@ -1253,7 +1254,7 @@ script_from_file (FILE *stream, char *file) if (stream == NULL) { - internal_error ("called with NULL file pointer!"); + internal_error (__FILE__, __LINE__, "called with NULL file pointer!"); } old_cleanups = make_cleanup (do_fclose_cleanup, stream); diff --git a/gdb/cli/cli-setshow.c b/gdb/cli/cli-setshow.c index b6cbfed90f..47ad244a6e 100644 --- a/gdb/cli/cli-setshow.c +++ b/gdb/cli/cli-setshow.c @@ -1,5 +1,5 @@ /* Handle set and show GDB commands. - Copyright 2000 Free Software Foundation, Inc. + Copyright 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -308,7 +308,8 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c) fputs_filtered ("auto", stb->stream); break; default: - internal_error ("do_setshow_command: invalid var_auto_boolean"); + internal_error (__FILE__, __LINE__, + "do_setshow_command: invalid var_auto_boolean"); break; } break; @@ -378,7 +379,8 @@ do_setshow_command (char *arg, int from_tty, struct cmd_list_element *c) fputs_filtered ("auto", gdb_stdout); break; default: - internal_error ("do_setshow_command: invalid var_auto_boolean"); + internal_error (__FILE__, __LINE__, + "do_setshow_command: invalid var_auto_boolean"); break; } break; diff --git a/gdb/d10v-tdep.c b/gdb/d10v-tdep.c index 58e2e833fd..f0d749a292 100644 --- a/gdb/d10v-tdep.c +++ b/gdb/d10v-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for Mitsubishi D10V, for GDB. - Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -1259,7 +1259,8 @@ print_insn (CORE_ADDR memaddr, struct ui_file *stream) { /* If there's no disassembler, something is very wrong. */ if (tm_print_insn == NULL) - internal_error ("print_insn: no disassembler"); + internal_error (__FILE__, __LINE__, + "print_insn: no disassembler"); if (TARGET_BYTE_ORDER == BIG_ENDIAN) tm_print_insn_info.endian = BFD_ENDIAN_BIG; @@ -1523,7 +1524,8 @@ d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_little); break; default: - internal_error ("d10v_gdbarch_init: bad byte order for float format"); + internal_error (__FILE__, __LINE__, + "d10v_gdbarch_init: bad byte order for float format"); } set_gdbarch_use_generic_dummy_frames (gdbarch, 1); diff --git a/gdb/d30v-tdep.c b/gdb/d30v-tdep.c index b85d0b7374..a94a4d9e91 100644 --- a/gdb/d30v-tdep.c +++ b/gdb/d30v-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for Mitsubishi D30V, for GDB. - Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -1146,7 +1146,8 @@ print_insn (CORE_ADDR memaddr, struct ui_file *stream) { /* If there's no disassembler, something is very wrong. */ if (tm_print_insn == NULL) - internal_error ("print_insn: no disassembler"); + internal_error (__FILE__, __LINE__, + "print_insn: no disassembler"); if (TARGET_BYTE_ORDER == BIG_ENDIAN) tm_print_insn_info.endian = BFD_ENDIAN_BIG; diff --git a/gdb/defs.h b/gdb/defs.h index 092f21c5a8..f8e36dde42 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -869,9 +869,11 @@ extern NORETURN void error_stream (struct ui_file *) ATTR_NORETURN; message. */ extern char *error_last_message (void); -extern NORETURN void internal_verror (const char *, va_list ap) ATTR_NORETURN; +extern NORETURN void internal_verror (const char *file, int line, + const char *, va_list ap) ATTR_NORETURN; -extern NORETURN void internal_error (char *, ...) ATTR_NORETURN; +extern NORETURN void internal_error (const char *file, int line, + const char *, ...) ATTR_NORETURN ATTR_FORMAT (printf, 3, 4); extern NORETURN void nomem (long) ATTR_NORETURN; diff --git a/gdb/dsrec.c b/gdb/dsrec.c index 6065380917..7c7941ee14 100644 --- a/gdb/dsrec.c +++ b/gdb/dsrec.c @@ -1,5 +1,5 @@ /* S-record download support for GDB, the GNU debugger. - Copyright 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -250,7 +250,8 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect, else if (tmp & SREC_4_BYTE_ADDR) addr_size = 4; else - internal_error ("make_srec: Bad address (0x%x), or bad flags (0x%x).", + internal_error (__FILE__, __LINE__, + "make_srec: Bad address (0x%x), or bad flags (0x%x).", targ_addr, flags); /* Now that we know the address size, we can figure out how much diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index f91aa38178..d612ccab7b 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1,5 +1,6 @@ /* DWARF 2 debugging format support for GDB. - Copyright 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 2001 + Free Software Foundation, Inc. Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology, Inc. with support from Florida State University (under contract @@ -948,7 +949,8 @@ read_comp_unit_head (struct comp_unit_head *cu_header, info_ptr += 1; signed_addr = bfd_get_sign_extend_vma (abfd); if (signed_addr < 0) - internal_error ("read_comp_unit_head: dwarf from non elf file"); + internal_error (__FILE__, __LINE__, + "read_comp_unit_head: dwarf from non elf file"); cu_header->signed_addr_p = signed_addr; return info_ptr; } @@ -3471,7 +3473,8 @@ read_address (bfd *abfd, char *buf, const struct comp_unit_head *cu_header, retval = bfd_get_signed_64 (abfd, (bfd_byte *) buf); break; default: - internal_error ("read_address: bad switch, signed"); + internal_error (__FILE__, __LINE__, + "read_address: bad switch, signed"); } } else @@ -3488,7 +3491,8 @@ read_address (bfd *abfd, char *buf, const struct comp_unit_head *cu_header, retval = bfd_get_64 (abfd, (bfd_byte *) buf); break; default: - internal_error ("read_address: bad switch, unsigned"); + internal_error (__FILE__, __LINE__, + "read_address: bad switch, unsigned"); } } @@ -3573,7 +3577,8 @@ read_offset (bfd *abfd, char *buf, const struct comp_unit_head *cu_header, *bytes_read = 8; break; default: - internal_error ("read_offset: bad switch"); + internal_error (__FILE__, __LINE__, + "read_offset: bad switch"); } return retval; diff --git a/gdb/elfread.c b/gdb/elfread.c index 2a5e536a49..5c91971b92 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -1,5 +1,6 @@ /* Read ELF (Executable and Linking Format) object files for GDB. - Copyright 1991, 92, 93, 94, 95, 96, 1998 Free Software Foundation, Inc. + Copyright 1991, 92, 93, 94, 95, 96, 1998, 2001 + Free Software Foundation, Inc. Written by Fred Fish at Cygnus Support. This file is part of GDB. @@ -464,7 +465,8 @@ elf_symtab_read (struct objfile *objfile, int dynamic) } } else - internal_error ("Section index uninitialized."); + internal_error (__FILE__, __LINE__, + "Section index uninitialized."); /* Bfd symbols are section relative. */ symaddr = sym->value + sym->section->vma; /* Relocate non-absolute symbols by the section offset. */ @@ -475,7 +477,8 @@ elf_symtab_read (struct objfile *objfile, int dynamic) if (index != -1) sectinfo->sections[index] = symaddr; else - internal_error ("Section index uninitialized."); + internal_error (__FILE__, __LINE__, + "Section index uninitialized."); /* The special local symbols don't go in the minimal symbol table, so ignore this one. */ continue; diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 1ae2a82e1a..300fe56931 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -484,7 +484,8 @@ add_file_handler (int fd, handler_func * proc, gdb_client_data client_data) if (poll (&fds, 1, 0) == 1 && (fds.revents & POLLNVAL)) use_poll = 0; #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } if (use_poll) @@ -492,7 +493,8 @@ add_file_handler (int fd, handler_func * proc, gdb_client_data client_data) #ifdef HAVE_POLL create_file_handler (fd, POLLIN, proc, client_data); #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif } else @@ -552,7 +554,8 @@ create_file_handler (int fd, int mask, handler_func * proc, gdb_client_data clie (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->events = mask; (gdb_notifier.poll_fds + gdb_notifier.num_fds - 1)->revents = 0; #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else @@ -624,7 +627,8 @@ delete_file_handler (int fd) gdb_notifier.poll_fds = new_poll_fds; gdb_notifier.num_fds--; #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else @@ -725,7 +729,8 @@ handle_file_event (int event_file_desc) else file_ptr->error = 0; #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else @@ -786,7 +791,8 @@ gdb_wait_for_event (void) if (num_found == -1 && errno != EINTR) perror_with_name ("Poll"); #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else @@ -847,7 +853,8 @@ gdb_wait_for_event (void) file_ptr->ready_mask = (gdb_notifier.poll_fds + i)->revents; } #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else @@ -1167,7 +1174,8 @@ poll_timers (void) #ifdef HAVE_POLL gdb_notifier.poll_timeout = delta.tv_sec * 1000; #else - internal_error ("event-loop.c : use_poll without HAVE_POLL"); + internal_error (__FILE__, __LINE__, + "use_poll without HAVE_POLL"); #endif /* HAVE_POLL */ } else diff --git a/gdb/f-lang.c b/gdb/f-lang.c index c466c51ac5..46c52ade71 100644 --- a/gdb/f-lang.c +++ b/gdb/f-lang.c @@ -1,5 +1,5 @@ /* Fortran language support routines for GDB, the GNU debugger. - Copyright 1993, 1994, 1996, 2000 Free Software Foundation, Inc. + Copyright 1993, 1994, 1996, 2000, 2001 Free Software Foundation, Inc. Contributed by Motorola. Adapted from the C parser by Farooq Butt (fmbutt@engage.sps.mot.com). @@ -896,7 +896,8 @@ get_bf_for_fcn (long the_function) item at the head of the queue is the one you want) */ if (saved_bf_list == NULL) - internal_error ("cannot get .bf node off empty list"); + internal_error (__FILE__, __LINE__, + "cannot get .bf node off empty list"); if (current_head_bf_list != NULL) if (current_head_bf_list->symnum_fcn == the_function) diff --git a/gdb/findvar.c b/gdb/findvar.c index ea6cccf025..88ca315887 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -1,5 +1,5 @@ /* Find a variable's value in memory, for GDB, the GNU debugger. - Copyright 1986, 87, 89, 91, 94, 95, 96, 1998 + Copyright 1986, 87, 89, 91, 94, 95, 96, 1998, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -190,7 +190,8 @@ extract_typed_address (void *buf, struct type *type) { if (TYPE_CODE (type) != TYPE_CODE_PTR && TYPE_CODE (type) != TYPE_CODE_REF) - internal_error ("findvar.c (extract_typed_address): " + internal_error (__FILE__, __LINE__, + "extract_typed_address: " "type is not a pointer or reference"); return POINTER_TO_ADDRESS (type, buf); @@ -276,7 +277,8 @@ store_typed_address (void *buf, struct type *type, CORE_ADDR addr) { if (TYPE_CODE (type) != TYPE_CODE_PTR && TYPE_CODE (type) != TYPE_CODE_REF) - internal_error ("findvar.c (store_typed_address): " + internal_error (__FILE__, __LINE__, + "store_typed_address: " "type is not a pointer or reference"); ADDRESS_TO_POINTER (type, buf, addr); @@ -415,7 +417,8 @@ value_of_register (int regnum) memcpy (VALUE_CONTENTS_RAW (reg_val), raw_buffer, REGISTER_RAW_SIZE (regnum)); else - internal_error ("Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size", + internal_error (__FILE__, __LINE__, + "Register \"%s\" (%d) has conflicting raw (%d) and virtual (%d) size", REGISTER_NAME (regnum), regnum, REGISTER_RAW_SIZE (regnum), @@ -874,7 +877,8 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) VALUE_ADDRESS (v) = first_addr; } else - internal_error ("value_from_register: Value not stored anywhere!"); + internal_error (__FILE__, __LINE__, + "value_from_register: Value not stored anywhere!"); VALUE_OPTIMIZED_OUT (v) = optim; diff --git a/gdb/gdb_assert.h b/gdb/gdb_assert.h index 85e3deeda3..c9979dbddf 100644 --- a/gdb/gdb_assert.h +++ b/gdb/gdb_assert.h @@ -1,5 +1,5 @@ /* GDB-friendly replacement for . - Copyright 2000 Free Software Foundation, Inc. + Copyright 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -43,8 +43,7 @@ /* This prints an "Assertion failed" message, aksing the user if they want to continue, dump core, or just exit. */ #define gdb_assert_fail(assertion, file, line, function) \ - internal_error ("%s:%u: %s%sAssertion `%s' failed.", \ - file, line, \ + internal_error (file, line, "%s%sAssertion `%s' failed.", \ function ? function : "", function ? ": " : "", \ assertion) diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 44c26a841f..4ff794c23b 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -488,9 +488,11 @@ verify_gdbarch (struct gdbarch *gdbarch) return; /* fundamental */ if (gdbarch->byte_order == 0) - internal_error ("verify_gdbarch: byte-order unset"); + internal_error (__FILE__, __LINE__, + "verify_gdbarch: byte-order unset"); if (gdbarch->bfd_arch_info == NULL) - internal_error ("verify_gdbarch: bfd_arch_info unset"); + internal_error (__FILE__, __LINE__, + "verify_gdbarch: bfd_arch_info unset"); /* Check those that need to be defined for the given multi-arch level. */ /* Skip verify of short_bit, invalid_p == 0 */ /* Skip verify of int_bit, invalid_p == 0 */ @@ -512,17 +514,21 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of write_sp, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->num_regs == -1)) - internal_error ("gdbarch: verify_gdbarch: num_regs invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: num_regs invalid"); /* Skip verify of num_pseudo_regs, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->sp_regnum == -1)) - internal_error ("gdbarch: verify_gdbarch: sp_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: sp_regnum invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->fp_regnum == -1)) - internal_error ("gdbarch: verify_gdbarch: fp_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: fp_regnum invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->pc_regnum == -1)) - internal_error ("gdbarch: verify_gdbarch: pc_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: pc_regnum invalid"); /* Skip verify of fp0_regnum, invalid_p == 0 */ /* Skip verify of npc_regnum, invalid_p == 0 */ /* Skip verify of nnpc_regnum, invalid_p == 0 */ @@ -534,73 +540,94 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of register_name, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_size == -1)) - internal_error ("gdbarch: verify_gdbarch: register_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: register_size invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_bytes == -1)) - internal_error ("gdbarch: verify_gdbarch: register_bytes invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: register_bytes invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_byte == 0)) - internal_error ("gdbarch: verify_gdbarch: register_byte invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: register_byte invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_raw_size == 0)) - internal_error ("gdbarch: verify_gdbarch: register_raw_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: register_raw_size invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->max_register_raw_size == -1)) - internal_error ("gdbarch: verify_gdbarch: max_register_raw_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: max_register_raw_size invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_virtual_size == 0)) - internal_error ("gdbarch: verify_gdbarch: register_virtual_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: register_virtual_size invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->max_register_virtual_size == -1)) - internal_error ("gdbarch: verify_gdbarch: max_register_virtual_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: max_register_virtual_size invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->register_virtual_type == 0)) - internal_error ("gdbarch: verify_gdbarch: register_virtual_type invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: register_virtual_type invalid"); /* Skip verify of do_registers_info, invalid_p == 0 */ /* Skip verify of register_sim_regno, invalid_p == 0 */ /* Skip verify of register_bytes_ok, has predicate */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->use_generic_dummy_frames == -1)) - internal_error ("gdbarch: verify_gdbarch: use_generic_dummy_frames invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: use_generic_dummy_frames invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_location == 0)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_location invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_location invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_location == AT_ENTRY_POINT && gdbarch->call_dummy_address == 0)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_address invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_start_offset == -1)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_start_offset invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_start_offset invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_breakpoint_offset == -1)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset invalid"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->call_dummy_breakpoint_offset_p == -1)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_breakpoint_offset_p invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_length == -1)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_length invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_length invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->pc_in_call_dummy == 0)) - internal_error ("gdbarch: verify_gdbarch: pc_in_call_dummy invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: pc_in_call_dummy invalid"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->call_dummy_p == -1)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_p invalid"); /* Skip verify of call_dummy_words, invalid_p == 0 */ /* Skip verify of sizeof_call_dummy_words, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->call_dummy_stack_adjust_p == -1)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_stack_adjust_p invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0)) - internal_error ("gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: call_dummy_stack_adjust invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->fix_call_dummy == 0)) - internal_error ("gdbarch: verify_gdbarch: fix_call_dummy invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: fix_call_dummy invalid"); /* Skip verify of coerce_float_to_double, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 1) && (gdbarch->get_saved_register == 0)) - internal_error ("gdbarch: verify_gdbarch: get_saved_register invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: get_saved_register invalid"); /* Skip verify of register_convertible, invalid_p == 0 */ /* Skip verify of register_convert_to_virtual, invalid_p == 0 */ /* Skip verify of register_convert_to_raw, invalid_p == 0 */ @@ -611,19 +638,24 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of return_value_on_stack, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->extract_return_value == 0)) - internal_error ("gdbarch: verify_gdbarch: extract_return_value invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: extract_return_value invalid"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->push_arguments == 0)) - internal_error ("gdbarch: verify_gdbarch: push_arguments invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: push_arguments invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->push_dummy_frame == 0)) - internal_error ("gdbarch: verify_gdbarch: push_dummy_frame invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: push_dummy_frame invalid"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->push_return_address == 0)) - internal_error ("gdbarch: verify_gdbarch: push_return_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: push_return_address invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->pop_frame == 0)) - internal_error ("gdbarch: verify_gdbarch: pop_frame invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: pop_frame invalid"); /* Skip verify of d10v_make_daddr, invalid_p == 0 */ /* Skip verify of d10v_make_iaddr, invalid_p == 0 */ /* Skip verify of d10v_daddr_p, invalid_p == 0 */ @@ -632,64 +664,82 @@ verify_gdbarch (struct gdbarch *gdbarch) /* Skip verify of d10v_convert_iaddr_to_raw, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->store_struct_return == 0)) - internal_error ("gdbarch: verify_gdbarch: store_struct_return invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: store_struct_return invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->store_return_value == 0)) - internal_error ("gdbarch: verify_gdbarch: store_return_value invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: store_return_value invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->extract_struct_value_address == 0)) - internal_error ("gdbarch: verify_gdbarch: extract_struct_value_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: extract_struct_value_address invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->use_struct_convention == 0)) - internal_error ("gdbarch: verify_gdbarch: use_struct_convention invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: use_struct_convention invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_init_saved_regs == 0)) - internal_error ("gdbarch: verify_gdbarch: frame_init_saved_regs invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_init_saved_regs invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->init_extra_frame_info == 0)) - internal_error ("gdbarch: verify_gdbarch: init_extra_frame_info invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: init_extra_frame_info invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->skip_prologue == 0)) - internal_error ("gdbarch: verify_gdbarch: skip_prologue invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: skip_prologue invalid"); /* Skip verify of prologue_frameless_p, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->inner_than == 0)) - internal_error ("gdbarch: verify_gdbarch: inner_than invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: inner_than invalid"); /* Skip verify of breakpoint_from_pc, invalid_p == 0 */ /* Skip verify of memory_insert_breakpoint, invalid_p == 0 */ /* Skip verify of memory_remove_breakpoint, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->decr_pc_after_break == -1)) - internal_error ("gdbarch: verify_gdbarch: decr_pc_after_break invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: decr_pc_after_break invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->function_start_offset == -1)) - internal_error ("gdbarch: verify_gdbarch: function_start_offset invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: function_start_offset invalid"); /* Skip verify of remote_translate_xfer_address, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_args_skip == -1)) - internal_error ("gdbarch: verify_gdbarch: frame_args_skip invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_args_skip invalid"); /* Skip verify of frameless_function_invocation, invalid_p == 0 */ if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_chain == 0)) - internal_error ("gdbarch: verify_gdbarch: frame_chain invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_chain invalid"); if ((GDB_MULTI_ARCH >= 1) && (gdbarch->frame_chain_valid == 0)) - internal_error ("gdbarch: verify_gdbarch: frame_chain_valid invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_chain_valid invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_saved_pc == 0)) - internal_error ("gdbarch: verify_gdbarch: frame_saved_pc invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_saved_pc invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_args_address == 0)) - internal_error ("gdbarch: verify_gdbarch: frame_args_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_args_address invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_locals_address == 0)) - internal_error ("gdbarch: verify_gdbarch: frame_locals_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_locals_address invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->saved_pc_after_call == 0)) - internal_error ("gdbarch: verify_gdbarch: saved_pc_after_call invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: saved_pc_after_call invalid"); if ((GDB_MULTI_ARCH >= 2) && (gdbarch->frame_num_args == 0)) - internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: verify_gdbarch: frame_num_args invalid"); /* Skip verify of stack_align, has predicate */ /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */ /* Skip verify of reg_struct_has_addr, has predicate */ @@ -2247,7 +2297,8 @@ int gdbarch_addr_bit (struct gdbarch *gdbarch) { if (gdbarch->addr_bit == 0) - internal_error ("gdbarch: gdbarch_addr_bit invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_addr_bit invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n"); return gdbarch->addr_bit; @@ -2296,7 +2347,8 @@ CORE_ADDR gdbarch_read_pc (struct gdbarch *gdbarch, int pid) { if (gdbarch->read_pc == 0) - internal_error ("gdbarch: gdbarch_read_pc invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_read_pc invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_read_pc called\n"); return gdbarch->read_pc (pid); @@ -2313,7 +2365,8 @@ void gdbarch_write_pc (struct gdbarch *gdbarch, CORE_ADDR val, int pid) { if (gdbarch->write_pc == 0) - internal_error ("gdbarch: gdbarch_write_pc invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_write_pc invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_write_pc called\n"); gdbarch->write_pc (val, pid); @@ -2330,7 +2383,8 @@ CORE_ADDR gdbarch_read_fp (struct gdbarch *gdbarch) { if (gdbarch->read_fp == 0) - internal_error ("gdbarch: gdbarch_read_fp invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_read_fp invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_read_fp called\n"); return gdbarch->read_fp (); @@ -2347,7 +2401,8 @@ void gdbarch_write_fp (struct gdbarch *gdbarch, CORE_ADDR val) { if (gdbarch->write_fp == 0) - internal_error ("gdbarch: gdbarch_write_fp invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_write_fp invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_write_fp called\n"); gdbarch->write_fp (val); @@ -2364,7 +2419,8 @@ CORE_ADDR gdbarch_read_sp (struct gdbarch *gdbarch) { if (gdbarch->read_sp == 0) - internal_error ("gdbarch: gdbarch_read_sp invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_read_sp invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_read_sp called\n"); return gdbarch->read_sp (); @@ -2381,7 +2437,8 @@ void gdbarch_write_sp (struct gdbarch *gdbarch, CORE_ADDR val) { if (gdbarch->write_sp == 0) - internal_error ("gdbarch: gdbarch_write_sp invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_write_sp invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_write_sp called\n"); gdbarch->write_sp (val); @@ -2398,7 +2455,8 @@ int gdbarch_num_regs (struct gdbarch *gdbarch) { if (gdbarch->num_regs == -1) - internal_error ("gdbarch: gdbarch_num_regs invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_num_regs invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_num_regs called\n"); return gdbarch->num_regs; @@ -2431,7 +2489,8 @@ int gdbarch_sp_regnum (struct gdbarch *gdbarch) { if (gdbarch->sp_regnum == -1) - internal_error ("gdbarch: gdbarch_sp_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_sp_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_sp_regnum called\n"); return gdbarch->sp_regnum; @@ -2448,7 +2507,8 @@ int gdbarch_fp_regnum (struct gdbarch *gdbarch) { if (gdbarch->fp_regnum == -1) - internal_error ("gdbarch: gdbarch_fp_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_fp_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_fp_regnum called\n"); return gdbarch->fp_regnum; @@ -2465,7 +2525,8 @@ int gdbarch_pc_regnum (struct gdbarch *gdbarch) { if (gdbarch->pc_regnum == -1) - internal_error ("gdbarch: gdbarch_pc_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_pc_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_regnum called\n"); return gdbarch->pc_regnum; @@ -2530,7 +2591,8 @@ int gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr) { if (gdbarch->stab_reg_to_regnum == 0) - internal_error ("gdbarch: gdbarch_stab_reg_to_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_stab_reg_to_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n"); return gdbarch->stab_reg_to_regnum (stab_regnr); @@ -2547,7 +2609,8 @@ int gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr) { if (gdbarch->ecoff_reg_to_regnum == 0) - internal_error ("gdbarch: gdbarch_ecoff_reg_to_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_ecoff_reg_to_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n"); return gdbarch->ecoff_reg_to_regnum (ecoff_regnr); @@ -2564,7 +2627,8 @@ int gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr) { if (gdbarch->dwarf_reg_to_regnum == 0) - internal_error ("gdbarch: gdbarch_dwarf_reg_to_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_dwarf_reg_to_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n"); return gdbarch->dwarf_reg_to_regnum (dwarf_regnr); @@ -2581,7 +2645,8 @@ int gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr) { if (gdbarch->sdb_reg_to_regnum == 0) - internal_error ("gdbarch: gdbarch_sdb_reg_to_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_sdb_reg_to_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n"); return gdbarch->sdb_reg_to_regnum (sdb_regnr); @@ -2598,7 +2663,8 @@ int gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr) { if (gdbarch->dwarf2_reg_to_regnum == 0) - internal_error ("gdbarch: gdbarch_dwarf2_reg_to_regnum invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_dwarf2_reg_to_regnum invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n"); return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr); @@ -2615,7 +2681,8 @@ char * gdbarch_register_name (struct gdbarch *gdbarch, int regnr) { if (gdbarch->register_name == 0) - internal_error ("gdbarch: gdbarch_register_name invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_name invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_name called\n"); return gdbarch->register_name (regnr); @@ -2632,7 +2699,8 @@ int gdbarch_register_size (struct gdbarch *gdbarch) { if (gdbarch->register_size == -1) - internal_error ("gdbarch: gdbarch_register_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_size invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_size called\n"); return gdbarch->register_size; @@ -2649,7 +2717,8 @@ int gdbarch_register_bytes (struct gdbarch *gdbarch) { if (gdbarch->register_bytes == -1) - internal_error ("gdbarch: gdbarch_register_bytes invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_bytes invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes called\n"); return gdbarch->register_bytes; @@ -2666,7 +2735,8 @@ int gdbarch_register_byte (struct gdbarch *gdbarch, int reg_nr) { if (gdbarch->register_byte == 0) - internal_error ("gdbarch: gdbarch_register_byte invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_byte invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_byte called\n"); return gdbarch->register_byte (reg_nr); @@ -2683,7 +2753,8 @@ int gdbarch_register_raw_size (struct gdbarch *gdbarch, int reg_nr) { if (gdbarch->register_raw_size == 0) - internal_error ("gdbarch: gdbarch_register_raw_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_raw_size invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_raw_size called\n"); return gdbarch->register_raw_size (reg_nr); @@ -2700,7 +2771,8 @@ int gdbarch_max_register_raw_size (struct gdbarch *gdbarch) { if (gdbarch->max_register_raw_size == -1) - internal_error ("gdbarch: gdbarch_max_register_raw_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_max_register_raw_size invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_raw_size called\n"); return gdbarch->max_register_raw_size; @@ -2717,7 +2789,8 @@ int gdbarch_register_virtual_size (struct gdbarch *gdbarch, int reg_nr) { if (gdbarch->register_virtual_size == 0) - internal_error ("gdbarch: gdbarch_register_virtual_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_virtual_size invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_size called\n"); return gdbarch->register_virtual_size (reg_nr); @@ -2734,7 +2807,8 @@ int gdbarch_max_register_virtual_size (struct gdbarch *gdbarch) { if (gdbarch->max_register_virtual_size == -1) - internal_error ("gdbarch: gdbarch_max_register_virtual_size invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_max_register_virtual_size invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_max_register_virtual_size called\n"); return gdbarch->max_register_virtual_size; @@ -2751,7 +2825,8 @@ struct type * gdbarch_register_virtual_type (struct gdbarch *gdbarch, int reg_nr) { if (gdbarch->register_virtual_type == 0) - internal_error ("gdbarch: gdbarch_register_virtual_type invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_virtual_type invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_virtual_type called\n"); return gdbarch->register_virtual_type (reg_nr); @@ -2768,7 +2843,8 @@ void gdbarch_do_registers_info (struct gdbarch *gdbarch, int reg_nr, int fpregs) { if (gdbarch->do_registers_info == 0) - internal_error ("gdbarch: gdbarch_do_registers_info invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_do_registers_info invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_do_registers_info called\n"); gdbarch->do_registers_info (reg_nr, fpregs); @@ -2785,7 +2861,8 @@ int gdbarch_register_sim_regno (struct gdbarch *gdbarch, int reg_nr) { if (gdbarch->register_sim_regno == 0) - internal_error ("gdbarch: gdbarch_register_sim_regno invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_sim_regno invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_sim_regno called\n"); return gdbarch->register_sim_regno (reg_nr); @@ -2808,7 +2885,8 @@ int gdbarch_register_bytes_ok (struct gdbarch *gdbarch, long nr_bytes) { if (gdbarch->register_bytes_ok == 0) - internal_error ("gdbarch: gdbarch_register_bytes_ok invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_bytes_ok invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_bytes_ok called\n"); return gdbarch->register_bytes_ok (nr_bytes); @@ -2825,7 +2903,8 @@ int gdbarch_use_generic_dummy_frames (struct gdbarch *gdbarch) { if (gdbarch->use_generic_dummy_frames == -1) - internal_error ("gdbarch: gdbarch_use_generic_dummy_frames invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_use_generic_dummy_frames invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_use_generic_dummy_frames called\n"); return gdbarch->use_generic_dummy_frames; @@ -2842,7 +2921,8 @@ int gdbarch_call_dummy_location (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_location == 0) - internal_error ("gdbarch: gdbarch_call_dummy_location invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_location invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_location called\n"); return gdbarch->call_dummy_location; @@ -2859,7 +2939,8 @@ CORE_ADDR gdbarch_call_dummy_address (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_address == 0) - internal_error ("gdbarch: gdbarch_call_dummy_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_address called\n"); return gdbarch->call_dummy_address (); @@ -2876,7 +2957,8 @@ CORE_ADDR gdbarch_call_dummy_start_offset (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_start_offset == -1) - internal_error ("gdbarch: gdbarch_call_dummy_start_offset invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_start_offset invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_start_offset called\n"); return gdbarch->call_dummy_start_offset; @@ -2893,7 +2975,8 @@ CORE_ADDR gdbarch_call_dummy_breakpoint_offset (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_breakpoint_offset == -1) - internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_breakpoint_offset invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset called\n"); return gdbarch->call_dummy_breakpoint_offset; @@ -2910,7 +2993,8 @@ int gdbarch_call_dummy_breakpoint_offset_p (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_breakpoint_offset_p == -1) - internal_error ("gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_breakpoint_offset_p invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_breakpoint_offset_p called\n"); return gdbarch->call_dummy_breakpoint_offset_p; @@ -2927,7 +3011,8 @@ int gdbarch_call_dummy_length (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_length == -1) - internal_error ("gdbarch: gdbarch_call_dummy_length invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_length invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_length called\n"); return gdbarch->call_dummy_length; @@ -2944,7 +3029,8 @@ int gdbarch_pc_in_call_dummy (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp, CORE_ADDR frame_address) { if (gdbarch->pc_in_call_dummy == 0) - internal_error ("gdbarch: gdbarch_pc_in_call_dummy invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_pc_in_call_dummy invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pc_in_call_dummy called\n"); return gdbarch->pc_in_call_dummy (pc, sp, frame_address); @@ -2961,7 +3047,8 @@ int gdbarch_call_dummy_p (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_p == -1) - internal_error ("gdbarch: gdbarch_call_dummy_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_p invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_p called\n"); return gdbarch->call_dummy_p; @@ -3010,7 +3097,8 @@ int gdbarch_call_dummy_stack_adjust_p (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_stack_adjust_p == -1) - internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_stack_adjust_p invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust_p called\n"); return gdbarch->call_dummy_stack_adjust_p; @@ -3027,7 +3115,8 @@ int gdbarch_call_dummy_stack_adjust (struct gdbarch *gdbarch) { if (gdbarch->call_dummy_stack_adjust_p && gdbarch->call_dummy_stack_adjust == 0) - internal_error ("gdbarch: gdbarch_call_dummy_stack_adjust invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_call_dummy_stack_adjust invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_call_dummy_stack_adjust called\n"); return gdbarch->call_dummy_stack_adjust; @@ -3044,7 +3133,8 @@ void gdbarch_fix_call_dummy (struct gdbarch *gdbarch, char *dummy, CORE_ADDR pc, CORE_ADDR fun, int nargs, struct value **args, struct type *type, int gcc_p) { if (gdbarch->fix_call_dummy == 0) - internal_error ("gdbarch: gdbarch_fix_call_dummy invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_fix_call_dummy invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_fix_call_dummy called\n"); gdbarch->fix_call_dummy (dummy, pc, fun, nargs, args, type, gcc_p); @@ -3091,7 +3181,8 @@ int gdbarch_coerce_float_to_double (struct gdbarch *gdbarch, struct type *formal, struct type *actual) { if (gdbarch->coerce_float_to_double == 0) - internal_error ("gdbarch: gdbarch_coerce_float_to_double invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_coerce_float_to_double invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_coerce_float_to_double called\n"); return gdbarch->coerce_float_to_double (formal, actual); @@ -3108,7 +3199,8 @@ void gdbarch_get_saved_register (struct gdbarch *gdbarch, char *raw_buffer, int *optimized, CORE_ADDR *addrp, struct frame_info *frame, int regnum, enum lval_type *lval) { if (gdbarch->get_saved_register == 0) - internal_error ("gdbarch: gdbarch_get_saved_register invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_get_saved_register invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_get_saved_register called\n"); gdbarch->get_saved_register (raw_buffer, optimized, addrp, frame, regnum, lval); @@ -3125,7 +3217,8 @@ int gdbarch_register_convertible (struct gdbarch *gdbarch, int nr) { if (gdbarch->register_convertible == 0) - internal_error ("gdbarch: gdbarch_register_convertible invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_convertible invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convertible called\n"); return gdbarch->register_convertible (nr); @@ -3142,7 +3235,8 @@ void gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, int regnum, struct type *type, char *from, char *to) { if (gdbarch->register_convert_to_virtual == 0) - internal_error ("gdbarch: gdbarch_register_convert_to_virtual invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_convert_to_virtual invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_virtual called\n"); gdbarch->register_convert_to_virtual (regnum, type, from, to); @@ -3159,7 +3253,8 @@ void gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, struct type *type, int regnum, char *from, char *to) { if (gdbarch->register_convert_to_raw == 0) - internal_error ("gdbarch: gdbarch_register_convert_to_raw invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_register_convert_to_raw invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_register_convert_to_raw called\n"); gdbarch->register_convert_to_raw (type, regnum, from, to); @@ -3176,7 +3271,8 @@ void gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, int regnum) { if (gdbarch->fetch_pseudo_register == 0) - internal_error ("gdbarch: gdbarch_fetch_pseudo_register invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_fetch_pseudo_register invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_fetch_pseudo_register called\n"); gdbarch->fetch_pseudo_register (regnum); @@ -3193,7 +3289,8 @@ void gdbarch_store_pseudo_register (struct gdbarch *gdbarch, int regnum) { if (gdbarch->store_pseudo_register == 0) - internal_error ("gdbarch: gdbarch_store_pseudo_register invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_store_pseudo_register invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_store_pseudo_register called\n"); gdbarch->store_pseudo_register (regnum); @@ -3210,7 +3307,8 @@ CORE_ADDR gdbarch_pointer_to_address (struct gdbarch *gdbarch, struct type *type, void *buf) { if (gdbarch->pointer_to_address == 0) - internal_error ("gdbarch: gdbarch_pointer_to_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_pointer_to_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pointer_to_address called\n"); return gdbarch->pointer_to_address (type, buf); @@ -3227,7 +3325,8 @@ void gdbarch_address_to_pointer (struct gdbarch *gdbarch, struct type *type, void *buf, CORE_ADDR addr) { if (gdbarch->address_to_pointer == 0) - internal_error ("gdbarch: gdbarch_address_to_pointer invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_address_to_pointer invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_address_to_pointer called\n"); gdbarch->address_to_pointer (type, buf, addr); @@ -3244,7 +3343,8 @@ int gdbarch_return_value_on_stack (struct gdbarch *gdbarch, struct type *type) { if (gdbarch->return_value_on_stack == 0) - internal_error ("gdbarch: gdbarch_return_value_on_stack invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_return_value_on_stack invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_return_value_on_stack called\n"); return gdbarch->return_value_on_stack (type); @@ -3261,7 +3361,8 @@ void gdbarch_extract_return_value (struct gdbarch *gdbarch, struct type *type, char *regbuf, char *valbuf) { if (gdbarch->extract_return_value == 0) - internal_error ("gdbarch: gdbarch_extract_return_value invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_extract_return_value invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_return_value called\n"); gdbarch->extract_return_value (type, regbuf, valbuf); @@ -3278,7 +3379,8 @@ CORE_ADDR gdbarch_push_arguments (struct gdbarch *gdbarch, int nargs, struct value **args, CORE_ADDR sp, int struct_return, CORE_ADDR struct_addr) { if (gdbarch->push_arguments == 0) - internal_error ("gdbarch: gdbarch_push_arguments invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_push_arguments invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_push_arguments called\n"); return gdbarch->push_arguments (nargs, args, sp, struct_return, struct_addr); @@ -3295,7 +3397,8 @@ void gdbarch_push_dummy_frame (struct gdbarch *gdbarch) { if (gdbarch->push_dummy_frame == 0) - internal_error ("gdbarch: gdbarch_push_dummy_frame invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_push_dummy_frame invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_push_dummy_frame called\n"); gdbarch->push_dummy_frame (); @@ -3312,7 +3415,8 @@ CORE_ADDR gdbarch_push_return_address (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR sp) { if (gdbarch->push_return_address == 0) - internal_error ("gdbarch: gdbarch_push_return_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_push_return_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_push_return_address called\n"); return gdbarch->push_return_address (pc, sp); @@ -3329,7 +3433,8 @@ void gdbarch_pop_frame (struct gdbarch *gdbarch) { if (gdbarch->pop_frame == 0) - internal_error ("gdbarch: gdbarch_pop_frame invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_pop_frame invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_pop_frame called\n"); gdbarch->pop_frame (); @@ -3346,7 +3451,8 @@ CORE_ADDR gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, CORE_ADDR x) { if (gdbarch->d10v_make_daddr == 0) - internal_error ("gdbarch: gdbarch_d10v_make_daddr invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_d10v_make_daddr invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_daddr called\n"); return gdbarch->d10v_make_daddr (x); @@ -3363,7 +3469,8 @@ CORE_ADDR gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, CORE_ADDR x) { if (gdbarch->d10v_make_iaddr == 0) - internal_error ("gdbarch: gdbarch_d10v_make_iaddr invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_d10v_make_iaddr invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_make_iaddr called\n"); return gdbarch->d10v_make_iaddr (x); @@ -3380,7 +3487,8 @@ int gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, CORE_ADDR x) { if (gdbarch->d10v_daddr_p == 0) - internal_error ("gdbarch: gdbarch_d10v_daddr_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_d10v_daddr_p invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_daddr_p called\n"); return gdbarch->d10v_daddr_p (x); @@ -3397,7 +3505,8 @@ int gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, CORE_ADDR x) { if (gdbarch->d10v_iaddr_p == 0) - internal_error ("gdbarch: gdbarch_d10v_iaddr_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_d10v_iaddr_p invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_iaddr_p called\n"); return gdbarch->d10v_iaddr_p (x); @@ -3414,7 +3523,8 @@ CORE_ADDR gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x) { if (gdbarch->d10v_convert_daddr_to_raw == 0) - internal_error ("gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_d10v_convert_daddr_to_raw invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_daddr_to_raw called\n"); return gdbarch->d10v_convert_daddr_to_raw (x); @@ -3431,7 +3541,8 @@ CORE_ADDR gdbarch_d10v_convert_iaddr_to_raw (struct gdbarch *gdbarch, CORE_ADDR x) { if (gdbarch->d10v_convert_iaddr_to_raw == 0) - internal_error ("gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_d10v_convert_iaddr_to_raw invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_d10v_convert_iaddr_to_raw called\n"); return gdbarch->d10v_convert_iaddr_to_raw (x); @@ -3448,7 +3559,8 @@ void gdbarch_store_struct_return (struct gdbarch *gdbarch, CORE_ADDR addr, CORE_ADDR sp) { if (gdbarch->store_struct_return == 0) - internal_error ("gdbarch: gdbarch_store_struct_return invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_store_struct_return invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_store_struct_return called\n"); gdbarch->store_struct_return (addr, sp); @@ -3465,7 +3577,8 @@ void gdbarch_store_return_value (struct gdbarch *gdbarch, struct type *type, char *valbuf) { if (gdbarch->store_return_value == 0) - internal_error ("gdbarch: gdbarch_store_return_value invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_store_return_value invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_store_return_value called\n"); gdbarch->store_return_value (type, valbuf); @@ -3482,7 +3595,8 @@ CORE_ADDR gdbarch_extract_struct_value_address (struct gdbarch *gdbarch, char *regbuf) { if (gdbarch->extract_struct_value_address == 0) - internal_error ("gdbarch: gdbarch_extract_struct_value_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_extract_struct_value_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_extract_struct_value_address called\n"); return gdbarch->extract_struct_value_address (regbuf); @@ -3499,7 +3613,8 @@ int gdbarch_use_struct_convention (struct gdbarch *gdbarch, int gcc_p, struct type *value_type) { if (gdbarch->use_struct_convention == 0) - internal_error ("gdbarch: gdbarch_use_struct_convention invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_use_struct_convention invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_use_struct_convention called\n"); return gdbarch->use_struct_convention (gcc_p, value_type); @@ -3516,7 +3631,8 @@ void gdbarch_frame_init_saved_regs (struct gdbarch *gdbarch, struct frame_info *frame) { if (gdbarch->frame_init_saved_regs == 0) - internal_error ("gdbarch: gdbarch_frame_init_saved_regs invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_init_saved_regs invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_init_saved_regs called\n"); gdbarch->frame_init_saved_regs (frame); @@ -3533,7 +3649,8 @@ void gdbarch_init_extra_frame_info (struct gdbarch *gdbarch, int fromleaf, struct frame_info *frame) { if (gdbarch->init_extra_frame_info == 0) - internal_error ("gdbarch: gdbarch_init_extra_frame_info invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_init_extra_frame_info invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_init_extra_frame_info called\n"); gdbarch->init_extra_frame_info (fromleaf, frame); @@ -3550,7 +3667,8 @@ CORE_ADDR gdbarch_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR ip) { if (gdbarch->skip_prologue == 0) - internal_error ("gdbarch: gdbarch_skip_prologue invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_skip_prologue invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_prologue called\n"); return gdbarch->skip_prologue (ip); @@ -3567,7 +3685,8 @@ int gdbarch_prologue_frameless_p (struct gdbarch *gdbarch, CORE_ADDR ip) { if (gdbarch->prologue_frameless_p == 0) - internal_error ("gdbarch: gdbarch_prologue_frameless_p invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_prologue_frameless_p invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_prologue_frameless_p called\n"); return gdbarch->prologue_frameless_p (ip); @@ -3584,7 +3703,8 @@ int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) { if (gdbarch->inner_than == 0) - internal_error ("gdbarch: gdbarch_inner_than invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_inner_than invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_inner_than called\n"); return gdbarch->inner_than (lhs, rhs); @@ -3601,7 +3721,8 @@ unsigned char * gdbarch_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) { if (gdbarch->breakpoint_from_pc == 0) - internal_error ("gdbarch: gdbarch_breakpoint_from_pc invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_breakpoint_from_pc invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_breakpoint_from_pc called\n"); return gdbarch->breakpoint_from_pc (pcptr, lenptr); @@ -3618,7 +3739,8 @@ int gdbarch_memory_insert_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) { if (gdbarch->memory_insert_breakpoint == 0) - internal_error ("gdbarch: gdbarch_memory_insert_breakpoint invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_memory_insert_breakpoint invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_insert_breakpoint called\n"); return gdbarch->memory_insert_breakpoint (addr, contents_cache); @@ -3635,7 +3757,8 @@ int gdbarch_memory_remove_breakpoint (struct gdbarch *gdbarch, CORE_ADDR addr, char *contents_cache) { if (gdbarch->memory_remove_breakpoint == 0) - internal_error ("gdbarch: gdbarch_memory_remove_breakpoint invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_memory_remove_breakpoint invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_memory_remove_breakpoint called\n"); return gdbarch->memory_remove_breakpoint (addr, contents_cache); @@ -3652,7 +3775,8 @@ CORE_ADDR gdbarch_decr_pc_after_break (struct gdbarch *gdbarch) { if (gdbarch->decr_pc_after_break == -1) - internal_error ("gdbarch: gdbarch_decr_pc_after_break invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_decr_pc_after_break invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_decr_pc_after_break called\n"); return gdbarch->decr_pc_after_break; @@ -3669,7 +3793,8 @@ CORE_ADDR gdbarch_function_start_offset (struct gdbarch *gdbarch) { if (gdbarch->function_start_offset == -1) - internal_error ("gdbarch: gdbarch_function_start_offset invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_function_start_offset invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_function_start_offset called\n"); return gdbarch->function_start_offset; @@ -3686,7 +3811,8 @@ void gdbarch_remote_translate_xfer_address (struct gdbarch *gdbarch, CORE_ADDR gdb_addr, int gdb_len, CORE_ADDR *rem_addr, int *rem_len) { if (gdbarch->remote_translate_xfer_address == 0) - internal_error ("gdbarch: gdbarch_remote_translate_xfer_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_remote_translate_xfer_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_remote_translate_xfer_address called\n"); gdbarch->remote_translate_xfer_address (gdb_addr, gdb_len, rem_addr, rem_len); @@ -3703,7 +3829,8 @@ CORE_ADDR gdbarch_frame_args_skip (struct gdbarch *gdbarch) { if (gdbarch->frame_args_skip == -1) - internal_error ("gdbarch: gdbarch_frame_args_skip invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_args_skip invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_skip called\n"); return gdbarch->frame_args_skip; @@ -3720,7 +3847,8 @@ int gdbarch_frameless_function_invocation (struct gdbarch *gdbarch, struct frame_info *fi) { if (gdbarch->frameless_function_invocation == 0) - internal_error ("gdbarch: gdbarch_frameless_function_invocation invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frameless_function_invocation invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frameless_function_invocation called\n"); return gdbarch->frameless_function_invocation (fi); @@ -3737,7 +3865,8 @@ CORE_ADDR gdbarch_frame_chain (struct gdbarch *gdbarch, struct frame_info *frame) { if (gdbarch->frame_chain == 0) - internal_error ("gdbarch: gdbarch_frame_chain invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_chain invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain called\n"); return gdbarch->frame_chain (frame); @@ -3754,7 +3883,8 @@ int gdbarch_frame_chain_valid (struct gdbarch *gdbarch, CORE_ADDR chain, struct frame_info *thisframe) { if (gdbarch->frame_chain_valid == 0) - internal_error ("gdbarch: gdbarch_frame_chain_valid invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_chain_valid invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_chain_valid called\n"); return gdbarch->frame_chain_valid (chain, thisframe); @@ -3771,7 +3901,8 @@ CORE_ADDR gdbarch_frame_saved_pc (struct gdbarch *gdbarch, struct frame_info *fi) { if (gdbarch->frame_saved_pc == 0) - internal_error ("gdbarch: gdbarch_frame_saved_pc invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_saved_pc invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_saved_pc called\n"); return gdbarch->frame_saved_pc (fi); @@ -3788,7 +3919,8 @@ CORE_ADDR gdbarch_frame_args_address (struct gdbarch *gdbarch, struct frame_info *fi) { if (gdbarch->frame_args_address == 0) - internal_error ("gdbarch: gdbarch_frame_args_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_args_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_args_address called\n"); return gdbarch->frame_args_address (fi); @@ -3805,7 +3937,8 @@ CORE_ADDR gdbarch_frame_locals_address (struct gdbarch *gdbarch, struct frame_info *fi) { if (gdbarch->frame_locals_address == 0) - internal_error ("gdbarch: gdbarch_frame_locals_address invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_locals_address invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_locals_address called\n"); return gdbarch->frame_locals_address (fi); @@ -3822,7 +3955,8 @@ CORE_ADDR gdbarch_saved_pc_after_call (struct gdbarch *gdbarch, struct frame_info *frame) { if (gdbarch->saved_pc_after_call == 0) - internal_error ("gdbarch: gdbarch_saved_pc_after_call invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_saved_pc_after_call invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_saved_pc_after_call called\n"); return gdbarch->saved_pc_after_call (frame); @@ -3839,7 +3973,8 @@ int gdbarch_frame_num_args (struct gdbarch *gdbarch, struct frame_info *frame) { if (gdbarch->frame_num_args == 0) - internal_error ("gdbarch: gdbarch_frame_num_args invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_frame_num_args invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_frame_num_args called\n"); return gdbarch->frame_num_args (frame); @@ -3862,7 +3997,8 @@ CORE_ADDR gdbarch_stack_align (struct gdbarch *gdbarch, CORE_ADDR sp) { if (gdbarch->stack_align == 0) - internal_error ("gdbarch: gdbarch_stack_align invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_stack_align invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_stack_align called\n"); return gdbarch->stack_align (sp); @@ -3901,7 +4037,8 @@ int gdbarch_reg_struct_has_addr (struct gdbarch *gdbarch, int gcc_p, struct type *type) { if (gdbarch->reg_struct_has_addr == 0) - internal_error ("gdbarch: gdbarch_reg_struct_has_addr invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_reg_struct_has_addr invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_reg_struct_has_addr called\n"); return gdbarch->reg_struct_has_addr (gcc_p, type); @@ -3924,7 +4061,8 @@ void gdbarch_save_dummy_frame_tos (struct gdbarch *gdbarch, CORE_ADDR sp) { if (gdbarch->save_dummy_frame_tos == 0) - internal_error ("gdbarch: gdbarch_save_dummy_frame_tos invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_save_dummy_frame_tos invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_save_dummy_frame_tos called\n"); gdbarch->save_dummy_frame_tos (sp); @@ -4001,7 +4139,8 @@ CORE_ADDR gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr) { if (gdbarch->convert_from_func_ptr_addr == 0) - internal_error ("gdbarch: gdbarch_convert_from_func_ptr_addr invalid"); + internal_error (__FILE__, __LINE__, + "gdbarch: gdbarch_convert_from_func_ptr_addr invalid"); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n"); return gdbarch->convert_from_func_ptr_addr (addr); @@ -4266,7 +4405,8 @@ gdbarch_printable_names (void) const struct bfd_arch_info *ap; ap = bfd_lookup_arch (rego->bfd_architecture, 0); if (ap == NULL) - internal_error ("gdbarch_architecture_names: multi-arch unknown"); + internal_error (__FILE__, __LINE__, + "gdbarch_architecture_names: multi-arch unknown"); do { append_name (&arches, &nr_arches, ap->printable_name); @@ -4295,7 +4435,9 @@ gdbarch_register (enum bfd_architecture bfd_architecture, bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); if (bfd_arch_info == NULL) { - internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture); + internal_error (__FILE__, __LINE__, + "gdbarch: Attempt to register unknown architecture (%d)", + bfd_architecture); } /* Check that we haven't seen this architecture before */ for (curr = &gdbarch_registry; @@ -4303,8 +4445,9 @@ gdbarch_register (enum bfd_architecture bfd_architecture, curr = &(*curr)->next) { if (bfd_architecture == (*curr)->bfd_architecture) - internal_error ("gdbarch: Duplicate registraration of architecture (%s)", - bfd_arch_info->printable_name); + internal_error (__FILE__, __LINE__, + "gdbarch: Duplicate registraration of architecture (%s)", + bfd_arch_info->printable_name); } /* log it */ if (gdbarch_debug) diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 9db0ae38bc..18c5b159f8 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -638,7 +638,7 @@ extern int gdbarch_register_bytes_ok_p (struct gdbarch *gdbarch); /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_BYTES_OK) -#define REGISTER_BYTES_OK(nr_bytes) (internal_error ("REGISTER_BYTES_OK"), 0) +#define REGISTER_BYTES_OK(nr_bytes) (internal_error (__FILE__, __LINE__, "REGISTER_BYTES_OK"), 0) #endif typedef int (gdbarch_register_bytes_ok_ftype) (long nr_bytes); @@ -830,7 +830,7 @@ extern void set_gdbarch_register_convertible (struct gdbarch *gdbarch, gdbarch_r /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_VIRTUAL) -#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error ("REGISTER_CONVERT_TO_VIRTUAL"), 0) +#define REGISTER_CONVERT_TO_VIRTUAL(regnum, type, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_VIRTUAL"), 0) #endif typedef void (gdbarch_register_convert_to_virtual_ftype) (int regnum, struct type *type, char *from, char *to); @@ -844,7 +844,7 @@ extern void set_gdbarch_register_convert_to_virtual (struct gdbarch *gdbarch, gd /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REGISTER_CONVERT_TO_RAW) -#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error ("REGISTER_CONVERT_TO_RAW"), 0) +#define REGISTER_CONVERT_TO_RAW(type, regnum, from, to) (internal_error (__FILE__, __LINE__, "REGISTER_CONVERT_TO_RAW"), 0) #endif typedef void (gdbarch_register_convert_to_raw_ftype) (struct type *type, int regnum, char *from, char *to); @@ -862,7 +862,7 @@ extern void set_gdbarch_register_convert_to_raw (struct gdbarch *gdbarch, gdbarc /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (FETCH_PSEUDO_REGISTER) -#define FETCH_PSEUDO_REGISTER(regnum) (internal_error ("FETCH_PSEUDO_REGISTER"), 0) +#define FETCH_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "FETCH_PSEUDO_REGISTER"), 0) #endif typedef void (gdbarch_fetch_pseudo_register_ftype) (int regnum); @@ -880,7 +880,7 @@ extern void set_gdbarch_fetch_pseudo_register (struct gdbarch *gdbarch, gdbarch_ /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (STORE_PSEUDO_REGISTER) -#define STORE_PSEUDO_REGISTER(regnum) (internal_error ("STORE_PSEUDO_REGISTER"), 0) +#define STORE_PSEUDO_REGISTER(regnum) (internal_error (__FILE__, __LINE__, "STORE_PSEUDO_REGISTER"), 0) #endif typedef void (gdbarch_store_pseudo_register_ftype) (int regnum); @@ -983,7 +983,7 @@ extern void set_gdbarch_pop_frame (struct gdbarch *gdbarch, gdbarch_pop_frame_ft /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_DADDR) -#define D10V_MAKE_DADDR(x) (internal_error ("D10V_MAKE_DADDR"), 0) +#define D10V_MAKE_DADDR(x) (internal_error (__FILE__, __LINE__, "D10V_MAKE_DADDR"), 0) #endif typedef CORE_ADDR (gdbarch_d10v_make_daddr_ftype) (CORE_ADDR x); @@ -997,7 +997,7 @@ extern void set_gdbarch_d10v_make_daddr (struct gdbarch *gdbarch, gdbarch_d10v_m /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (D10V_MAKE_IADDR) -#define D10V_MAKE_IADDR(x) (internal_error ("D10V_MAKE_IADDR"), 0) +#define D10V_MAKE_IADDR(x) (internal_error (__FILE__, __LINE__, "D10V_MAKE_IADDR"), 0) #endif typedef CORE_ADDR (gdbarch_d10v_make_iaddr_ftype) (CORE_ADDR x); @@ -1011,7 +1011,7 @@ extern void set_gdbarch_d10v_make_iaddr (struct gdbarch *gdbarch, gdbarch_d10v_m /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (D10V_DADDR_P) -#define D10V_DADDR_P(x) (internal_error ("D10V_DADDR_P"), 0) +#define D10V_DADDR_P(x) (internal_error (__FILE__, __LINE__, "D10V_DADDR_P"), 0) #endif typedef int (gdbarch_d10v_daddr_p_ftype) (CORE_ADDR x); @@ -1025,7 +1025,7 @@ extern void set_gdbarch_d10v_daddr_p (struct gdbarch *gdbarch, gdbarch_d10v_dadd /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (D10V_IADDR_P) -#define D10V_IADDR_P(x) (internal_error ("D10V_IADDR_P"), 0) +#define D10V_IADDR_P(x) (internal_error (__FILE__, __LINE__, "D10V_IADDR_P"), 0) #endif typedef int (gdbarch_d10v_iaddr_p_ftype) (CORE_ADDR x); @@ -1039,7 +1039,7 @@ extern void set_gdbarch_d10v_iaddr_p (struct gdbarch *gdbarch, gdbarch_d10v_iadd /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_DADDR_TO_RAW) -#define D10V_CONVERT_DADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_DADDR_TO_RAW"), 0) +#define D10V_CONVERT_DADDR_TO_RAW(x) (internal_error (__FILE__, __LINE__, "D10V_CONVERT_DADDR_TO_RAW"), 0) #endif typedef CORE_ADDR (gdbarch_d10v_convert_daddr_to_raw_ftype) (CORE_ADDR x); @@ -1053,7 +1053,7 @@ extern void set_gdbarch_d10v_convert_daddr_to_raw (struct gdbarch *gdbarch, gdba /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (D10V_CONVERT_IADDR_TO_RAW) -#define D10V_CONVERT_IADDR_TO_RAW(x) (internal_error ("D10V_CONVERT_IADDR_TO_RAW"), 0) +#define D10V_CONVERT_IADDR_TO_RAW(x) (internal_error (__FILE__, __LINE__, "D10V_CONVERT_IADDR_TO_RAW"), 0) #endif typedef CORE_ADDR (gdbarch_d10v_convert_iaddr_to_raw_ftype) (CORE_ADDR x); @@ -1325,7 +1325,7 @@ extern int gdbarch_stack_align_p (struct gdbarch *gdbarch); /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (STACK_ALIGN) -#define STACK_ALIGN(sp) (internal_error ("STACK_ALIGN"), 0) +#define STACK_ALIGN(sp) (internal_error (__FILE__, __LINE__, "STACK_ALIGN"), 0) #endif typedef CORE_ADDR (gdbarch_stack_align_ftype) (CORE_ADDR sp); @@ -1367,7 +1367,7 @@ extern int gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch); /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (REG_STRUCT_HAS_ADDR) -#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error ("REG_STRUCT_HAS_ADDR"), 0) +#define REG_STRUCT_HAS_ADDR(gcc_p, type) (internal_error (__FILE__, __LINE__, "REG_STRUCT_HAS_ADDR"), 0) #endif typedef int (gdbarch_reg_struct_has_addr_ftype) (int gcc_p, struct type *type); @@ -1396,7 +1396,7 @@ extern int gdbarch_save_dummy_frame_tos_p (struct gdbarch *gdbarch); /* Default (function) for non- multi-arch platforms. */ #if (!GDB_MULTI_ARCH) && !defined (SAVE_DUMMY_FRAME_TOS) -#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error ("SAVE_DUMMY_FRAME_TOS"), 0) +#define SAVE_DUMMY_FRAME_TOS(sp) (internal_error (__FILE__, __LINE__, "SAVE_DUMMY_FRAME_TOS"), 0) #endif typedef void (gdbarch_save_dummy_frame_tos_ftype) (CORE_ADDR sp); @@ -1748,7 +1748,7 @@ extern disassemble_info tm_print_insn_info; /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ #ifndef EXTRACT_STRUCT_VALUE_ADDRESS #define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) -#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) +#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) #else #ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P #define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 86dc4d6ea3..6a5eb1650d 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -678,7 +678,7 @@ do printf "#if (!GDB_MULTI_ARCH) && !defined (${macro})\n" if [ "${fallbackdefault}" = "0" ] then - printf "#define ${macro}(${actual}) (internal_error (\"${macro}\"), 0)\n" + printf "#define ${macro}(${actual}) (internal_error (__FILE__, __LINE__, \"${macro}\"), 0)\n" else # FIXME: Should be passing current_gdbarch through! echo "#define ${macro}(${actual}) (${fallbackdefault} (${actual}))" \ @@ -993,7 +993,7 @@ extern disassemble_info tm_print_insn_info; /* Fallback definition for EXTRACT_STRUCT_VALUE_ADDRESS */ #ifndef EXTRACT_STRUCT_VALUE_ADDRESS #define EXTRACT_STRUCT_VALUE_ADDRESS_P (0) -#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error ("gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) +#define EXTRACT_STRUCT_VALUE_ADDRESS(X) (internal_error (__FILE__, __LINE__, "gdbarch: EXTRACT_STRUCT_VALUE_ADDRESS"), 0) #else #ifndef EXTRACT_STRUCT_VALUE_ADDRESS_P #define EXTRACT_STRUCT_VALUE_ADDRESS_P (1) @@ -1275,9 +1275,11 @@ verify_gdbarch (struct gdbarch *gdbarch) return; /* fundamental */ if (gdbarch->byte_order == 0) - internal_error ("verify_gdbarch: byte-order unset"); + internal_error (__FILE__, __LINE__, + "verify_gdbarch: byte-order unset"); if (gdbarch->bfd_arch_info == NULL) - internal_error ("verify_gdbarch: bfd_arch_info unset"); + internal_error (__FILE__, __LINE__, + "verify_gdbarch: bfd_arch_info unset"); /* Check those that need to be defined for the given multi-arch level. */ EOF function_list | while do_read @@ -1307,12 +1309,14 @@ do then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (${invalid_p}))\n" - printf " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");\n" + printf " internal_error (__FILE__, __LINE__,\n" + printf " \"gdbarch: verify_gdbarch: ${function} invalid\");\n" elif [ "${predefault}" ] then printf " if ((GDB_MULTI_ARCH >= ${level})\n" printf " && (gdbarch->${function} == ${predefault}))\n" - printf " internal_error (\"gdbarch: verify_gdbarch: ${function} invalid\");\n" + printf " internal_error (__FILE__, __LINE__,\n" + printf " \"gdbarch: verify_gdbarch: ${function} invalid\");\n" fi fi done @@ -1437,7 +1441,8 @@ do fi printf "{\n" printf " if (gdbarch->${function} == 0)\n" - printf " internal_error (\"gdbarch: gdbarch_${function} invalid\");\n" + printf " internal_error (__FILE__, __LINE__,\n" + printf " \"gdbarch: gdbarch_${function} invalid\");\n" printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" test "${actual}" = "-" && actual="" @@ -1467,11 +1472,13 @@ do elif [ "${invalid_p}" ] then printf " if (${invalid_p})\n" - printf " internal_error (\"gdbarch: gdbarch_${function} invalid\");\n" + printf " internal_error (__FILE__, __LINE__,\n" + printf " \"gdbarch: gdbarch_${function} invalid\");\n" elif [ "${predefault}" ] then printf " if (gdbarch->${function} == ${predefault})\n" - printf " internal_error (\"gdbarch: gdbarch_${function} invalid\");\n" + printf " internal_error (__FILE__, __LINE__,\n" + printf " \"gdbarch: gdbarch_${function} invalid\");\n" fi printf " if (gdbarch_debug >= 2)\n" printf " fprintf_unfiltered (gdb_stdlog, \"gdbarch_${function} called\\\\n\");\n" @@ -1752,7 +1759,8 @@ gdbarch_printable_names (void) const struct bfd_arch_info *ap; ap = bfd_lookup_arch (rego->bfd_architecture, 0); if (ap == NULL) - internal_error ("gdbarch_architecture_names: multi-arch unknown"); + internal_error (__FILE__, __LINE__, + "gdbarch_architecture_names: multi-arch unknown"); do { append_name (&arches, &nr_arches, ap->printable_name); @@ -1781,7 +1789,9 @@ gdbarch_register (enum bfd_architecture bfd_architecture, bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0); if (bfd_arch_info == NULL) { - internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture); + internal_error (__FILE__, __LINE__, + "gdbarch: Attempt to register unknown architecture (%d)", + bfd_architecture); } /* Check that we haven't seen this architecture before */ for (curr = &gdbarch_registry; @@ -1789,8 +1799,9 @@ gdbarch_register (enum bfd_architecture bfd_architecture, curr = &(*curr)->next) { if (bfd_architecture == (*curr)->bfd_architecture) - internal_error ("gdbarch: Duplicate registraration of architecture (%s)", - bfd_arch_info->printable_name); + internal_error (__FILE__, __LINE__, + "gdbarch: Duplicate registraration of architecture (%s)", + bfd_arch_info->printable_name); } /* log it */ if (gdbarch_debug) diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 0a84ab95d4..885662be76 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -1,5 +1,5 @@ /* Native debugging support for Intel x86 running DJGPP. - Copyright 1997, 1999 Free Software Foundation, Inc. + Copyright 1997, 1999, 2001 Free Software Foundation, Inc. Written by Robert Hoehne. This file is part of GDB. @@ -490,13 +490,14 @@ go32_fetch_registers (int regno) ((char *) &npx + regno_mapping[regno].tss_ofs); break; default: - internal_error ("\ + internal_error (__FILE__, __LINE__, "\ Invalid native size for register no. %d in go32_fetch_register.", regno); } supply_register (regno, (char *) ®val); } else - internal_error ("Invalid register no. %d in go32_fetch_register.", + internal_error (__FILE__, __LINE__, + "Invalid register no. %d in go32_fetch_register.", regno); } } @@ -514,7 +515,8 @@ store_register (int regno) else if (regno < 32) rp = (char *) &npx + regno_mapping[regno].tss_ofs; else - internal_error ("Invalid register no. %d in store_register.", regno); + internal_error (__FILE__, __LINE__, + "Invalid register no. %d in store_register.", regno); memcpy (rp, v, regno_mapping[regno].size); if (regno == FOP_REGNUM) *(short *)rp &= 0x07ff; /* strip high 5 bits, in case they added them */ @@ -620,7 +622,8 @@ go32_create_inferior (char *exec_file, char *args, char **env) /* Init command line storage. */ if (redir_debug_init (&child_cmd) == -1) - internal_error ("Cannot allocate redirection storage: not enough memory.\n"); + internal_error (__FILE__, __LINE__, + "Cannot allocate redirection storage: not enough memory.\n"); /* Parse the command line and create redirections. */ if (strpbrk (args, "<>")) @@ -1245,7 +1248,8 @@ init_go32_ops (void) /* Initialize child's command line storage. */ if (redir_debug_init (&child_cmd) == -1) - internal_error ("Cannot allocate redirection storage: not enough memory.\n"); + internal_error (__FILE__, __LINE__, + "Cannot allocate redirection storage: not enough memory.\n"); /* We are always processing GCC-compiled programs. */ processing_gcc_compilation = 2; diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c index c8bf04b0ae..840813d6c2 100644 --- a/gdb/hppah-nat.c +++ b/gdb/hppah-nat.c @@ -1,5 +1,6 @@ /* Native support code for HPUX PA-RISC. - Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1998, 1999 + Copyright 1986, 1987, 1989, 1990, 1991, 1992, 1993, 1998, 1999, + 2001 Free Software Foundation, Inc. Contributed by the Center for Software Science at the @@ -106,7 +107,8 @@ store_inferior_registers (int regno) addr = (HPPAH_OFFSETOF (save_state_t, ss_narrow) + (REGISTER_BYTE (regno) - REGISTER_BYTE (1))); else - internal_error ("hppah-nat.c (write_register): unexpected register size"); + internal_error (__FILE__, __LINE__, + "hppah-nat.c (write_register): unexpected register size"); #ifdef GDB_TARGET_IS_HPPA_20W /* Unbelieveable. The PC head and tail must be written in 64bit hunks @@ -222,7 +224,8 @@ fetch_register (int regno) + (REGISTER_BYTE (regno) - REGISTER_BYTE (1))); else - internal_error ("hppa-nat.c (fetch_register): unexpected register size"); + internal_error (__FILE__, __LINE__, + "hppa-nat.c (fetch_register): unexpected register size"); for (i = 0; i < len; i += sizeof (int)) { diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index a1541a9883..c92d96c08e 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -1,5 +1,5 @@ /* Native-dependent code for Linux/x86. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -600,7 +600,8 @@ fetch_inferior_registers (int regno) return; } - internal_error ("Got request for bad register number %d.", regno); + internal_error (__FILE__, __LINE__, + "Got request for bad register number %d.", regno); } /* Store register REGNO back into the child process. If REGNO is -1, @@ -653,7 +654,8 @@ store_inferior_registers (int regno) return; } - internal_error ("Got request to store bad register number %d.", regno); + internal_error (__FILE__, __LINE__, + "Got request to store bad register number %d.", regno); } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 0750efc962..7d7a5a844f 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1,5 +1,5 @@ /* Intel 386 target-dependent stuff. - Copyright (C) 1988, 1989, 1991, 1994, 1995, 1996, 1998 + Copyright (C) 1988, 1989, 1991, 1994, 1995, 1996, 1998, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -771,7 +771,8 @@ i386_extract_return_value (struct type *type, char *regbuf, char *valbuf) ®buf[REGISTER_BYTE (HIGH_RETURN_REGNUM)], len - low_size); } else - internal_error ("Cannot extract return value of %d bytes long.", len); + internal_error (__FILE__, __LINE__, + "Cannot extract return value of %d bytes long.", len); } } @@ -829,7 +830,8 @@ i386_store_return_value (struct type *type, char *valbuf) valbuf + low_size, len - low_size); } else - internal_error ("Cannot store return value of %d bytes long.", len); + internal_error (__FILE__, __LINE__, + "Cannot store return value of %d bytes long.", len); } } diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index dbda2efee5..0ace093742 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for the IA-64 for GDB, the GNU debugger. - Copyright 1999, 2000 + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -324,20 +324,21 @@ read_sigcontext_register (struct frame_info *frame, int regnum) CORE_ADDR regaddr; if (frame == NULL) - internal_error ("read_sigcontext_register: NULL frame"); + internal_error (__FILE__, __LINE__, + "read_sigcontext_register: NULL frame"); if (!frame->signal_handler_caller) - internal_error ( - "read_sigcontext_register: frame not a signal_handler_caller"); + internal_error (__FILE__, __LINE__, + "read_sigcontext_register: frame not a signal_handler_caller"); if (SIGCONTEXT_REGISTER_ADDRESS == 0) - internal_error ( - "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0"); + internal_error (__FILE__, __LINE__, + "read_sigcontext_register: SIGCONTEXT_REGISTER_ADDRESS is 0"); regaddr = SIGCONTEXT_REGISTER_ADDRESS (frame->frame, regnum); if (regaddr) return read_memory_integer (regaddr, REGISTER_RAW_SIZE (regnum)); else - internal_error ( - "read_sigcontext_register: Register %d not in struct sigcontext", regnum); + internal_error (__FILE__, __LINE__, + "read_sigcontext_register: Register %d not in struct sigcontext", regnum); } /* Extract ``len'' bits from an instruction bundle starting at @@ -1922,8 +1923,8 @@ process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj) *os_ident_ptr = ELFOSABI_SOLARIS; break; default : - internal_error ( - "process_note_abi_sections: unknown OS number %d", os_number); + internal_error (__FILE__, __LINE__, + "process_note_abi_sections: unknown OS number %d", os_number); break; } } diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 6eb3d83a38..5ae5c6a4b9 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1106,7 +1106,8 @@ finish_command_continuation (struct continuation_arg *arg) value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function)); if (!value_type) - internal_error ("finish_command: function has no target type"); + internal_error (__FILE__, __LINE__, + "finish_command: function has no target type"); if (TYPE_CODE (value_type) == TYPE_CODE_VOID) { @@ -1233,7 +1234,8 @@ finish_command (char *arg, int from_tty) value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (function)); if (!value_type) - internal_error ("finish_command: function has no target type"); + internal_error (__FILE__, __LINE__, + "finish_command: function has no target type"); /* FIXME: Shouldn't we do the cleanups before returning? */ if (TYPE_CODE (value_type) == TYPE_CODE_VOID) diff --git a/gdb/inferior.h b/gdb/inferior.h index 46597452b1..69464b5e53 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -1,6 +1,6 @@ /* Variables that describe the inferior process running under GDB: Where it is, why it stopped, and how to step it. - Copyright 1986, 1989, 1992, 1996, 1998 Free Software Foundation, Inc. + Copyright 1986, 1989, 1992, 1996, 1998, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -421,20 +421,20 @@ extern int attach_flag; #endif /* No CALL_DUMMY_LOCATION. */ #if !defined (CALL_DUMMY_ADDRESS) -#define CALL_DUMMY_ADDRESS() (internal_error ("CALL_DUMMY_ADDRESS"), 0) +#define CALL_DUMMY_ADDRESS() (internal_error (__FILE__, __LINE__, "CALL_DUMMY_ADDRESS"), 0) #endif #if !defined (CALL_DUMMY_START_OFFSET) -#define CALL_DUMMY_START_OFFSET (internal_error ("CALL_DUMMY_START_OFFSET"), 0) +#define CALL_DUMMY_START_OFFSET (internal_error (__FILE__, __LINE__, "CALL_DUMMY_START_OFFSET"), 0) #endif #if !defined (CALL_DUMMY_BREAKPOINT_OFFSET) #define CALL_DUMMY_BREAKPOINT_OFFSET_P (0) -#define CALL_DUMMY_BREAKPOINT_OFFSET (internal_error ("CALL_DUMMY_BREAKPOINT_OFFSET"), 0) +#define CALL_DUMMY_BREAKPOINT_OFFSET (internal_error (__FILE__, __LINE__, "CALL_DUMMY_BREAKPOINT_OFFSET"), 0) #endif #if !defined CALL_DUMMY_BREAKPOINT_OFFSET_P #define CALL_DUMMY_BREAKPOINT_OFFSET_P (1) #endif #if !defined (CALL_DUMMY_LENGTH) -#define CALL_DUMMY_LENGTH (internal_error ("CALL_DUMMY_LENGTH"), 0) +#define CALL_DUMMY_LENGTH (internal_error (__FILE__, __LINE__, "CALL_DUMMY_LENGTH"), 0) #endif #if defined (CALL_DUMMY_STACK_ADJUST) @@ -443,7 +443,7 @@ extern int attach_flag; #endif #endif #if !defined (CALL_DUMMY_STACK_ADJUST) -#define CALL_DUMMY_STACK_ADJUST (internal_error ("CALL_DUMMY_STACK_ADJUST"), 0) +#define CALL_DUMMY_STACK_ADJUST (internal_error (__FILE__, __LINE__, "CALL_DUMMY_STACK_ADJUST"), 0) #endif #if !defined (CALL_DUMMY_STACK_ADJUST_P) #define CALL_DUMMY_STACK_ADJUST_P (0) @@ -461,15 +461,15 @@ extern int attach_flag; #endif #if !defined PUSH_DUMMY_FRAME -#define PUSH_DUMMY_FRAME (internal_error ("PUSH_DUMMY_FRAME"), 0) +#define PUSH_DUMMY_FRAME (internal_error (__FILE__, __LINE__, "PUSH_DUMMY_FRAME"), 0) #endif #if !defined FIX_CALL_DUMMY -#define FIX_CALL_DUMMY(a1,a2,a3,a4,a5,a6,a7) (internal_error ("FIX_CALL_DUMMY"), 0) +#define FIX_CALL_DUMMY(a1,a2,a3,a4,a5,a6,a7) (internal_error (__FILE__, __LINE__, "FIX_CALL_DUMMY"), 0) #endif #if !defined STORE_STRUCT_RETURN -#define STORE_STRUCT_RETURN(a1,a2) (internal_error ("STORE_STRUCT_RETURN"), 0) +#define STORE_STRUCT_RETURN(a1,a2) (internal_error (__FILE__, __LINE__, "STORE_STRUCT_RETURN"), 0) #endif diff --git a/gdb/infptrace.c b/gdb/infptrace.c index f7a1a3a7e6..4841e9c6a0 100644 --- a/gdb/infptrace.c +++ b/gdb/infptrace.c @@ -340,7 +340,8 @@ _initialize_kernel_u_addr (void) if (nlist ("/vmunix", names) == 0) kernel_u_addr = names[0].n_value; else - internal_error ("Unable to get kernel u area address."); + internal_error (__FILE__, __LINE__, + "Unable to get kernel u area address."); #endif /* KERNEL_U_ADDR_BSD. */ } diff --git a/gdb/infrun.c b/gdb/infrun.c index 58ebfdd3d1..5266c88ca3 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -1,5 +1,5 @@ /* Target-struct-independent code to start (run) and stop an inferior process. - Copyright 1986-1989, 1991-2000 Free Software Foundation, Inc. + Copyright 1986-1989, 1991-2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -473,7 +473,8 @@ follow_inferior_fork (int parent_pid, int child_pid, int has_forked, /* Or, did the user not know, and want us to ask? */ if (follow_fork_mode_string == follow_fork_mode_ask) { - internal_error ("follow_inferior_fork: \"ask\" mode not implemented"); + internal_error (__FILE__, __LINE__, + "follow_inferior_fork: \"ask\" mode not implemented"); /* follow_mode = follow_fork_mode_...; */ } @@ -3384,7 +3385,8 @@ print_stop_reason (enum inferior_stop_reason stop_reason, int stop_info) #endif break; default: - internal_error ("print_stop_reason: unrecognized enum value"); + internal_error (__FILE__, __LINE__, + "print_stop_reason: unrecognized enum value"); break; } } @@ -3520,7 +3522,8 @@ and/or watchpoints.\n"); do_frame_printing = 0; break; default: - internal_error ("Unknown value."); + internal_error (__FILE__, __LINE__, + "Unknown value."); } #ifdef UI_OUT /* For mi, have the same behavior every time we stop: diff --git a/gdb/language.c b/gdb/language.c index a5b2a863f7..eedec98779 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -1,5 +1,5 @@ /* Multiple source language support for GDB. - Copyright 1991, 1992, 2000 Free Software Foundation, Inc. + Copyright 1991, 1992, 2000, 2001 Free Software Foundation, Inc. Contributed by the Department of Computer Science at the State University of New York at Buffalo. @@ -721,7 +721,8 @@ longest_local_hex_string_custom (LONGEST num, char *width) if (strlen (local_hex_format_prefix ()) + num_len + num_pad_chars < RESULT_BUF_LEN) /* paranoia */ - internal_error ("longest_local_hex_string_custom: insufficient space to store result"); + internal_error (__FILE__, __LINE__, + "longest_local_hex_string_custom: insufficient space to store result"); strcpy (res2, local_hex_format_prefix ()); if (pad_on_left) diff --git a/gdb/m3-nat.c b/gdb/m3-nat.c index b63b75fe80..ac11d13ded 100644 --- a/gdb/m3-nat.c +++ b/gdb/m3-nat.c @@ -1,7 +1,8 @@ /* Interface GDB to Mach 3.0 operating systems. (Most) Mach 3.0 related routines live in this file. - Copyright (C) 1992, 1996, 1999-2000 Free Software Foundation, Inc. + Copyright (C) 1992, 1996, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of GDB. @@ -1637,7 +1638,8 @@ catch_exception_raise (mach_port_t port, thread_t thread, task_t task, } if (exception < 0 || exception > MAX_EXCEPTION) - internal_error ("catch_exception_raise: unknown exception code %d thread %d", + internal_error (__FILE__, __LINE__, + "catch_exception_raise: unknown exception code %d thread %d", exception, mid); @@ -3498,7 +3500,8 @@ mach3_exception_actions (WAITTYPE *w, boolean_t force_print_only, char *who) stop_code); break; default: - internal_error ("Unknown exception"); + internal_error (__FILE__, __LINE__, + "Unknown exception"); } } } @@ -3523,13 +3526,15 @@ setup_notify_port (int create_new) MACH_PORT_RIGHT_RECEIVE, &our_notify_port); if (ret != KERN_SUCCESS) - internal_error ("Creating notify port %s", mach_error_string (ret)); + internal_error (__FILE__, __LINE__, + "Creating notify port %s", mach_error_string (ret)); ret = mach_port_move_member (mach_task_self (), our_notify_port, inferior_wait_port_set); if (ret != KERN_SUCCESS) - internal_error ("initial move member %s", mach_error_string (ret)); + internal_error (__FILE__, __LINE__, + "initial move member %s", mach_error_string (ret)); } } @@ -4499,7 +4504,8 @@ _initialize_m3_nat (void) MACH_PORT_RIGHT_PORT_SET, &inferior_wait_port_set); if (ret != KERN_SUCCESS) - internal_error ("initial port set %s", mach_error_string (ret)); + internal_error (__FILE__, __LINE__, + "initial port set %s", mach_error_string (ret)); /* mach_really_wait now waits for this */ currently_waiting_for = inferior_wait_port_set; diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 5a7715626c..c66615bea2 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1,5 +1,5 @@ /* Target dependent code for the Motorola 68000 series. - Copyright (C) 1990, 1992, 1993, 1994, 1995, 1996, 1999, 2000 + Copyright (C) 1990, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -672,7 +672,8 @@ m68k_get_longjmp_target (CORE_ADDR *pc) return 1; #else - internal_error ("m68k_get_longjmp_target: not implemented"); + internal_error (__FILE__, __LINE__, + "m68k_get_longjmp_target: not implemented"); return 0; #endif } diff --git a/gdb/maint.c b/gdb/maint.c index aa62e94adf..2dd2982ad6 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -1,5 +1,5 @@ /* Support for GDB maintenance commands. - Copyright 1992, 1993, 1994 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 2001 Free Software Foundation, Inc. Written by Fred Fish at Cygnus Support. This file is part of GDB. @@ -115,7 +115,8 @@ maintenance_dump_me (char *args, int from_tty) static void maintenance_internal_error (char *args, int from_tty) { - internal_error ("internal maintenance"); + internal_error (__FILE__, __LINE__, + "internal maintenance"); } /* Someday we should allow demangling for things other than just diff --git a/gdb/mi/ChangeLog b/gdb/mi/ChangeLog index 35a5930022..4e07ea6b62 100644 --- a/gdb/mi/ChangeLog +++ b/gdb/mi/ChangeLog @@ -1,3 +1,11 @@ +Wed Feb 7 19:50:37 2001 Andrew Cagney + + * mi-getopt.c: Add __FILE__ and __LINE__ parameter to calls to + internal_error. + * mi-console.c: Ditto. + * mi-cmds.c: Ditto. + * mi-cmd-break.c: Ditto. + 2001-01-27 Fernando Nasser From Momchil Velikov diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index fc22be715f..dc2eb3722f 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -1,5 +1,5 @@ /* MI Command Set - breakpoint and watchpoint commands. - Copyright (C) 2000, Free Software Foundation, Inc. + Copyright 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Solutions (a Red Hat company). This file is part of GDB. @@ -161,7 +161,8 @@ mi_cmd_break_insert (char *command, char **argv, int argc) break; #endif default: - internal_error ("mi_cmd_break_insert: Bad switch."); + internal_error (__FILE__, __LINE__, + "mi_cmd_break_insert: Bad switch."); } set_gdb_event_hooks (old_hooks); diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c index 64ad4f6ee2..7bd36d3dd9 100644 --- a/gdb/mi/mi-cmds.c +++ b/gdb/mi/mi-cmds.c @@ -234,7 +234,8 @@ build_table (struct mi_cmd *commands) { struct mi_cmd **entry = lookup_table (command->name); if (*entry) - internal_error ("command `%s' appears to be duplicated", + internal_error (__FILE__, __LINE__, + "command `%s' appears to be duplicated", command->name); *entry = command; if (0) diff --git a/gdb/mi/mi-console.c b/gdb/mi/mi-console.c index dc9a217d75..149e89231a 100644 --- a/gdb/mi/mi-console.c +++ b/gdb/mi/mi-console.c @@ -65,7 +65,8 @@ mi_console_file_delete (struct ui_file *file) { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) - internal_error ("mi_console_file_delete: bad magic number"); + internal_error (__FILE__, __LINE__, + "mi_console_file_delete: bad magic number"); xfree (mi_console); } @@ -75,7 +76,8 @@ mi_console_file_fputs (const char *buf, { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) - internal_error ("mi_console_file_fputs: bad magic number"); + internal_error (__FILE__, __LINE__, + "mi_console_file_fputs: bad magic number"); /* Append the text to our internal buffer */ fputs_unfiltered (buf, mi_console->buffer); /* Flush when an embedded \n */ @@ -91,7 +93,8 @@ mi_console_raw_packet (void *data, { struct mi_console_file *mi_console = data; if (mi_console->magic != &mi_console_file_magic) - internal_error ("mi_console_file_transform: bad magic number"); + internal_error (__FILE__, __LINE__, + "mi_console_file_transform: bad magic number"); if (length_buf > 0) { @@ -108,7 +111,8 @@ mi_console_file_flush (struct ui_file *file) { struct mi_console_file *mi_console = ui_file_data (file); if (mi_console->magic != &mi_console_file_magic) - internal_error ("mi_console_file_flush: bad magic number"); + internal_error (__FILE__, __LINE__, + "mi_console_file_flush: bad magic number"); ui_file_put (mi_console->buffer, mi_console_raw_packet, mi_console); ui_file_rewind (mi_console->buffer); } diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c index 74cbd673e7..e87192020a 100644 --- a/gdb/mi/mi-getopt.c +++ b/gdb/mi/mi-getopt.c @@ -33,7 +33,8 @@ mi_getopt (const char *prefix, struct mi_opt *opt; /* We assume that argv/argc are ok. */ if (*optind > argc || *optind < 0) - internal_error ("mi_getopt_long: optind out of bounds"); + internal_error (__FILE__, __LINE__, + "mi_getopt_long: optind out of bounds"); if (*optind == argc) return -1; arg = argv[*optind]; diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 05ba0664ff..277eb358dc 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -477,7 +477,8 @@ mips_mask_address_p (void) case CMD_AUTO_BOOLEAN_AUTO: return MIPS_DEFAULT_MASK_ADDRESS_P; default: - internal_error ("mips_mask_address_p: bad switch"); + internal_error (__FILE__, __LINE__, + "mips_mask_address_p: bad switch"); return -1; } } @@ -498,7 +499,8 @@ show_mask_address (char *cmd, int from_tty) mips_mask_address_p () ? "enabled" : "disabled"); break; default: - internal_error ("show_mask_address: bad switch"); + internal_error (__FILE__, __LINE__, + "show_mask_address: bad switch"); break; } } @@ -982,7 +984,8 @@ unpack_mips16 (CORE_ADDR pc, break; } default: - internal_error ("%s:%d: bad switch", __FILE__, __LINE__); + internal_error (__FILE__, __LINE__, + "bad switch"); } upk->offset = offset; upk->regx = regx; diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index ef43ff7b47..0e03810d51 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -1,5 +1,6 @@ /* Target-dependent code for the Matsushita MN10300 for GDB, the GNU debugger. - Copyright 1996, 1997, 1998, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001 + Free Software Foundation, Inc. This file is part of GDB. @@ -974,7 +975,8 @@ mn10300_gdbarch_init (struct gdbarch_info info, num_regs = 32; break; default: - internal_error ("mn10300_gdbarch_init: Unknown mn10300 variant"); + internal_error (__FILE__, __LINE__, + "mn10300_gdbarch_init: Unknown mn10300 variant"); return NULL; /* keep GCC happy. */ } diff --git a/gdb/objfiles.c b/gdb/objfiles.c index d84770c0d5..0a329b7c79 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -1,5 +1,6 @@ /* GDB routines for manipulating objfiles. - Copyright 1992, 1993, 1994, 1995 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 2001 + Free Software Foundation, Inc. Contributed by Cygnus Support, using pieces from other GDB modules. This file is part of GDB. @@ -370,7 +371,8 @@ unlink_objfile (struct objfile *objfile) } } - internal_error ("objfiles.c (unlink_objfile): objfile already unlinked"); + internal_error (__FILE__, __LINE__, + "unlink_objfile: objfile already unlinked"); } diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 90a17403df..8969cd056c 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -1,5 +1,6 @@ /* Definitions for symbol file management in GDB. - Copyright (C) 1992, 1993, 1994, 1995, 1999 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1999, 2001 + Free Software Foundation, Inc. This file is part of GDB. @@ -586,16 +587,19 @@ extern int is_in_import_list (char *, struct objfile *); ALL_OBJFILE_OSECTIONS (objfile, osect) #define SECT_OFF_DATA(objfile) \ - ((objfile->sect_index_data == -1) ? \ - (internal_error ("sect_index_data not initialized"), -1) : objfile->sect_index_data) + ((objfile->sect_index_data == -1) \ + ? (internal_error (__FILE__, __LINE__, "sect_index_data not initialized"), -1) \ + : objfile->sect_index_data) #define SECT_OFF_RODATA(objfile) \ - ((objfile->sect_index_rodata == -1) ? \ - (internal_error ("sect_index_rodata not initialized"), -1) : objfile->sect_index_rodata) + ((objfile->sect_index_rodata == -1) \ + ? (internal_error (__FILE__, __LINE__, "sect_index_rodata not initialized"), -1) \ + : objfile->sect_index_rodata) #define SECT_OFF_TEXT(objfile) \ - ((objfile->sect_index_text == -1) ? \ - (internal_error ("sect_index_text not initialized"), -1) : objfile->sect_index_text) + ((objfile->sect_index_text == -1) \ + ? (internal_error (__FILE__, __LINE__, "sect_index_text not initialized"), -1) \ + : objfile->sect_index_text) /* Sometimes the .bss section is missing from the objfile, so we don't want to die here. Let the users of SECT_OFF_BSS deal with an diff --git a/gdb/regcache.c b/gdb/regcache.c index db963f769d..de6936b18d 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -1,5 +1,5 @@ /* Cache and manage the values of registers for GDB, the GNU debugger. - Copyright 1986, 87, 89, 91, 94, 95, 96, 1998, 2000 + Copyright 1986, 87, 89, 91, 94, 95, 96, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -776,7 +776,8 @@ generic_target_read_pc (int pid) return pc_val; } #endif - internal_error ("generic_target_read_pc"); + internal_error (__FILE__, __LINE__, + "generic_target_read_pc"); return 0; } @@ -813,7 +814,8 @@ generic_target_write_pc (CORE_ADDR pc, int pid) if (NNPC_REGNUM >= 0) write_register_pid (NNPC_REGNUM, pc + 8, pid); #else - internal_error ("generic_target_write_pc"); + internal_error (__FILE__, __LINE__, + "generic_target_write_pc"); #endif } @@ -846,7 +848,8 @@ generic_target_read_sp (void) if (SP_REGNUM >= 0) return read_register (SP_REGNUM); #endif - internal_error ("generic_target_read_sp"); + internal_error (__FILE__, __LINE__, + "generic_target_read_sp"); } CORE_ADDR @@ -865,7 +868,8 @@ generic_target_write_sp (CORE_ADDR val) return; } #endif - internal_error ("generic_target_write_sp"); + internal_error (__FILE__, __LINE__, + "generic_target_write_sp"); } void @@ -881,7 +885,8 @@ generic_target_read_fp (void) if (FP_REGNUM >= 0) return read_register (FP_REGNUM); #endif - internal_error ("generic_target_read_fp"); + internal_error (__FILE__, __LINE__, + "generic_target_read_fp"); } CORE_ADDR @@ -900,7 +905,8 @@ generic_target_write_fp (CORE_ADDR val) return; } #endif - internal_error ("generic_target_write_fp"); + internal_error (__FILE__, __LINE__, + "generic_target_write_fp"); } void diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index cc53c70681..01c6054422 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -1243,7 +1243,8 @@ mips_request (int cmd, if (cmd != '\0') { if (mips_need_reply) - internal_error ("mips_request: Trying to send command before reply"); + internal_error (__FILE__, __LINE__, + "mips_request: Trying to send command before reply"); sprintf (buff, "0x0 %c 0x%s 0x%s", cmd, paddr_nz (addr), paddr_nz (data)); mips_send_packet (buff, 1); mips_need_reply = 1; @@ -1253,7 +1254,8 @@ mips_request (int cmd, return 0; if (!mips_need_reply) - internal_error ("mips_request: Trying to get reply before command"); + internal_error (__FILE__, __LINE__, + "mips_request: Trying to get reply before command"); mips_need_reply = 0; diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 1976db9067..81baf52b83 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -335,7 +335,8 @@ gdbsim_store_register (int regno) REGISTER_SIM_REGNO (regno), tmp, REGISTER_RAW_SIZE (regno)); if (nr_bytes > 0 && nr_bytes != REGISTER_RAW_SIZE (regno)) - internal_error ("Register size different to expected"); + internal_error (__FILE__, __LINE__, + "Register size different to expected"); if (sr_get_debug ()) { printf_filtered ("gdbsim_store_register: %d", regno); @@ -481,7 +482,8 @@ gdbsim_open (char *args, int from_tty) strcat (arg_buf, " -E little"); break; default: - internal_error ("Value of TARGET_BYTE_ORDER unknown"); + internal_error (__FILE__, __LINE__, + "Value of TARGET_BYTE_ORDER unknown"); } } /* Specify the architecture of the target when it has been diff --git a/gdb/remote-vx.c b/gdb/remote-vx.c index 40b31a5475..f49fa7217d 100644 --- a/gdb/remote-vx.c +++ b/gdb/remote-vx.c @@ -976,7 +976,8 @@ vx_wait (int pid_to_wait_for, struct target_waitstatus *status) sleep_ms (200); /* FIXME Don't kill the network too badly */ } else if (pid != inferior_pid) - internal_error ("Bad pid for debugged task: %s\n", + internal_error (__FILE__, __LINE__, + "Bad pid for debugged task: %s\n", local_hex_string ((unsigned long) pid)); } while (pid == 0); diff --git a/gdb/remote.c b/gdb/remote.c index b79634d326..cba1442607 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -615,7 +615,8 @@ packet_ok (const char *buf, struct packet_config *config) config->support = PACKET_ENABLE; break; case PACKET_DISABLE: - internal_error ("packet_ok: attempt to use a disabled packet"); + internal_error (__FILE__, __LINE__, + "packet_ok: attempt to use a disabled packet"); break; case PACKET_ENABLE: break; @@ -1681,7 +1682,8 @@ remote_threads_extra_info (struct thread_info *tp) int n = 0; /* position in display_buf */ if (remote_desc == 0) /* paranoia */ - internal_error ("remote_threads_extra_info"); + internal_error (__FILE__, __LINE__, + "remote_threads_extra_info"); if (use_threadextra_query) { @@ -3364,10 +3366,10 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) todo = min (len, max_buf_size / 2); break; case PACKET_SUPPORT_UNKNOWN: - internal_error ("%s:%d: remote_write_bytes: bad internal state", - __FILE__, __LINE__); + internal_error (__FILE__, __LINE__, + "remote_write_bytes: bad internal state"); default: - internal_error ("%s:%d: bad switch", __FILE__, __LINE__); + internal_error (__FILE__, __LINE__, "bad switch"); } /* Append */ @@ -3431,10 +3433,10 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len) *p = '\0'; break; case PACKET_SUPPORT_UNKNOWN: - internal_error ("%s:%d: remote_write_bytes: bad internal state", - __FILE__, __LINE__); + internal_error (__FILE__, __LINE__, + "remote_write_bytes: bad internal state"); default: - internal_error ("%s:%d: bad switch", __FILE__, __LINE__); + internal_error (__FILE__, __LINE__, "bad switch"); } putpkt_binary (buf, (int) (p - buf)); @@ -4340,7 +4342,8 @@ watchpoint_to_Z_packet (int type) return 4; break; default: - internal_error ("hw_bp_to_z: bad watchpoint type %d", type); + internal_error (__FILE__, __LINE__, + "hw_bp_to_z: bad watchpoint type %d", type); } } @@ -4376,7 +4379,8 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type) case PACKET_OK: return 0; } - internal_error ("remote_insert_watchpoint: reached end of function"); + internal_error (__FILE__, __LINE__, + "remote_insert_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote @@ -4410,7 +4414,8 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type) case PACKET_OK: return 0; } - internal_error ("remote_remove_watchpoint: reached end of function"); + internal_error (__FILE__, __LINE__, + "remote_remove_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote @@ -4446,7 +4451,8 @@ remote_insert_hw_breakpoint (CORE_ADDR addr, int len) case PACKET_OK: return 0; } - internal_error ("remote_remove_watchpoint: reached end of function"); + internal_error (__FILE__, __LINE__, + "remote_remove_watchpoint: reached end of function"); } /* FIXME: This function should be static and a member of the remote @@ -4482,7 +4488,8 @@ remote_remove_hw_breakpoint (CORE_ADDR addr, int len) case PACKET_OK: return 0; } - internal_error ("remote_remove_watchpoint: reached end of function"); + internal_error (__FILE__, __LINE__, + "remote_remove_watchpoint: reached end of function"); } /* Some targets are only capable of doing downloads, and afterwards @@ -5405,7 +5412,8 @@ static void remote_async (void (*callback) (enum inferior_event_type event_type, void *context), void *context) { if (current_target.to_async_mask_value == 0) - internal_error ("Calling remote_async when async is masked"); + internal_error (__FILE__, __LINE__, + "Calling remote_async when async is masked"); if (callback != NULL) { diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index e890484850..a1df2c77ac 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -1,5 +1,6 @@ /* IBM RS/6000 native-dependent code for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1995, 1996, 1997, 1998 + Copyright 1986, 1987, 1989, 1991, 1992, 1994, 1995, 1996, 1997, + 1998, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -927,7 +928,8 @@ set_host_arch (int pid) if (!gdbarch_update_p (info)) { - internal_error ("set_host_arch: failed to select architecture"); + internal_error (__FILE__, __LINE__, + "set_host_arch: failed to select architecture"); } } diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index efdff362ab..94d09a62c0 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1,5 +1,6 @@ /* Target-dependent code for GDB, the GNU debugger. - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000 + Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, + 1997, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -2039,8 +2040,9 @@ process_note_abi_tag_sections (bfd *abfd, asection *sect, void *obj) *os_ident_ptr = ELFOSABI_SOLARIS; break; default : - internal_error ( - "process_note_abi_sections: unknown OS number %d", os_number); + internal_error (__FILE__, __LINE__, + "process_note_abi_sections: unknown OS number %d", + os_number); break; } } diff --git a/gdb/serial.c b/gdb/serial.c index 0f48947440..62c5bf089c 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -349,7 +349,8 @@ serial_readchar (serial_t scb, int timeout) /* FIXME: cagney/1999-10-11: Don't enable this check until the ASYNC code is finished. */ if (0 && SERIAL_IS_ASYNC_P (scb) && timeout < 0) - internal_error ("serial_readchar: blocking read in async mode"); + internal_error (__FILE__, __LINE__, + "serial_readchar: blocking read in async mode"); ch = scb->ops->readchar (scb, timeout); if (serial_logfp != NULL) @@ -508,7 +509,8 @@ deprecated_serial_fd (serial_t scb) called? */ if (scb->fd < 0) { - internal_error ("serial: FD not valid"); + internal_error (__FILE__, __LINE__, + "serial: FD not valid"); } return scb->fd; /* sigh */ } diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index a632030571..032bfe92c1 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -1731,7 +1731,8 @@ static void sh_do_pseudo_register (int regnum) { if (regnum < NUM_REGS || regnum >= NUM_REGS + NUM_PSEUDO_REGS) - internal_error ("Invalid pseudo register number %d\n", regnum); + internal_error (__FILE__, __LINE__, + "Invalid pseudo register number %d\n", regnum); else if (regnum >= gdbarch_tdep (current_gdbarch)->DR0_REGNUM && regnum < gdbarch_tdep (current_gdbarch)->DR_LAST_REGNUM) do_dr_register_info (regnum); @@ -1802,7 +1803,8 @@ static void sh_print_register (int regnum) { if (regnum < 0 || regnum >= NUM_REGS + NUM_PSEUDO_REGS) - internal_error ("Invalid register number %d\n", regnum); + internal_error (__FILE__, __LINE__, + "Invalid register number %d\n", regnum); else if (regnum >= 0 && regnum < NUM_REGS) { diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index c8183c702f..5c3938bacc 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -1,5 +1,5 @@ /* Handle SunOS and SVR4 shared libraries for GDB, the GNU Debugger. - Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 1999, 2000 + Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -210,7 +210,8 @@ default_svr4_fetch_link_map_offsets (void) #else - internal_error ("default_svr4_fetch_link_map_offsets called without HAVE_LINK_H defined."); + internal_error (__FILE__, __LINE__, + "default_svr4_fetch_link_map_offsets called without HAVE_LINK_H defined."); return 0; #endif /* HAVE_LINK_H */ diff --git a/gdb/solib.c b/gdb/solib.c index efbc1d167e..9808e8983d 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -616,8 +616,9 @@ info_sharedlibrary_command (char *ignore, int from_tty) } else { - internal_error ("%s:%d: bfd_get_arch_size() returned unknown size %d", - __FILE__, __LINE__, arch_size); + internal_error (__FILE__, __LINE__, + "bfd_get_arch_size() returned unknown size %d", + arch_size); } update_solib_list (from_tty, 0); diff --git a/gdb/source.c b/gdb/source.c index 8313aeec57..4a64c5529d 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -200,7 +200,9 @@ select_source_symtab (register struct symtab *s) { if (cs_pst->readin) { - internal_error ("select_source_symtab: readin pst found and no symtabs."); + internal_error (__FILE__, __LINE__, + "select_source_symtab: " + "readin pst found and no symtabs."); } else { diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 5f3fe454b4..e30ebb54cd 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -526,7 +526,8 @@ setup_arbitrary_frame (int argc, CORE_ADDR *argv) frame = create_new_frame (argv[0], 0); if (!frame) - internal_error ("create_new_frame returned invalid frame"); + internal_error (__FILE__, __LINE__, + "create_new_frame returned invalid frame"); frame->extra_info->bottom = argv[1]; frame->pc = FRAME_SAVED_PC (frame); @@ -1053,7 +1054,8 @@ sparc_frame_find_saved_regs (struct frame_info *fi, CORE_ADDR *saved_regs_addr) CORE_ADDR frame_addr = FRAME_FP (fi); if (!fi) - internal_error ("Bad frame info struct in FRAME_FIND_SAVED_REGS"); + internal_error (__FILE__, __LINE__, + "Bad frame info struct in FRAME_FIND_SAVED_REGS"); memset (saved_regs_addr, 0, NUM_REGS * sizeof (CORE_ADDR)); diff --git a/gdb/symm-nat.c b/gdb/symm-nat.c index 7fc706f017..144c111a9c 100644 --- a/gdb/symm-nat.c +++ b/gdb/symm-nat.c @@ -1,5 +1,6 @@ /* Sequent Symmetry host interface, for GDB when running under Unix. - Copyright 1986, 1987, 1989, 1991, 1992, 1994 Free Software Foundation, Inc. + Copyright 1986, 1987, 1989, 1991, 1992, 1994, 2001 + Free Software Foundation, Inc. This file is part of GDB. @@ -531,7 +532,8 @@ child_wait (int pid, struct target_waitstatus *status) } break; case PTS_WATCHPT_HIT: - internal_error ("PTS_WATCHPT_HIT\n"); + internal_error (__FILE__, __LINE__, + "PTS_WATCHPT_HIT\n"); break; default: /* stopped by signal */ @@ -844,7 +846,8 @@ _initialize_symm_nat (void) rv = mptrace (XPT_MPDEBUGGER, 0, 0, 0); if (-1 == rv) { - internal_error ("_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s", + internal_error (__FILE__, __LINE__, + "_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s", safe_strerror (errno)); } @@ -862,13 +865,15 @@ _initialize_symm_nat (void) rv = sigaddset (&set, SIGCHLD); if (-1 == rv) { - internal_error ("_initialize_symm_nat(): sigaddset(SIGCHLD): %s", + internal_error (__FILE__, __LINE__, + "_initialize_symm_nat(): sigaddset(SIGCHLD): %s", safe_strerror (errno)); } rv = sigprocmask (SIG_BLOCK, &set, (sigset_t *) NULL); if (-1 == rv) { - internal_error ("_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s", + internal_error (__FILE__, __LINE__, + "_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s", safe_strerror (errno)); } @@ -878,7 +883,8 @@ _initialize_symm_nat (void) rv = sigaction (SIGCHLD, &sact, (struct sigaction *) NULL); if (-1 == rv) { - internal_error ("_initialize_symm_nat(): sigaction(SIGCHLD): %s", + internal_error (__FILE__, __LINE__, + "_initialize_symm_nat(): sigaction(SIGCHLD): %s", safe_strerror (errno)); } #endif diff --git a/gdb/symtab.h b/gdb/symtab.h index bacf9b3e24..c7f52a7d70 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -828,8 +828,9 @@ struct section_offsets }; #define ANOFFSET(secoff, whichone) \ - ((whichone == -1) ? \ - (internal_error ("Section index is uninitialized"), -1) : secoff->offsets[whichone]) + ((whichone == -1) \ + ? (internal_error (__FILE__, __LINE__, "Section index is uninitialized"), -1) \ + : secoff->offsets[whichone]) /* The maximum possible size of a section_offsets table. */ diff --git a/gdb/target.h b/gdb/target.h index d007bbab47..a68e899366 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1396,7 +1396,7 @@ extern void push_remote_target (char *name, int from_tty); #ifndef SOFTWARE_SINGLE_STEP_P #define SOFTWARE_SINGLE_STEP_P 0 #define SOFTWARE_SINGLE_STEP(sig,bp_p) \ - (internal_error ("SOFTWARE_SINGLE_STEP"), 0) + (internal_error (__FILE__, __LINE__, "SOFTWARE_SINGLE_STEP"), 0) #endif /* SOFTWARE_SINGLE_STEP_P */ /* Blank target vector entries are initialized to target_ignore. */ diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 90264be7cd..d8e1646dfc 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,3 +1,8 @@ +Wed Feb 7 19:54:27 2001 Andrew Cagney + + * tui-file.c: Add __FILE__ and __LINE__ parameter to calls to + internal_error. + 2000-12-14 Kevin Buettner * tui-file.c, tui.c, tuiData.c, tuiLayout.c: Replace occurrences diff --git a/gdb/tui/tui-file.c b/gdb/tui/tui-file.c index bf3574bdbb..29f84f48d0 100644 --- a/gdb/tui/tui-file.c +++ b/gdb/tui/tui-file.c @@ -1,5 +1,5 @@ /* UI_FILE - a generic STDIO like output stream. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -85,7 +85,8 @@ tui_file_delete (struct ui_file *file) { struct tui_stream *tmpstream = ui_file_data (file); if (tmpstream->ts_magic != &tui_file_magic) - internal_error ("tui_file_delete: bad magic number"); + internal_error (__FILE__, __LINE__, + "tui_file_delete: bad magic number"); if ((tmpstream->ts_streamtype == astring) && (tmpstream->ts_strbuf != NULL)) { @@ -131,7 +132,8 @@ tui_file_isatty (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) - internal_error ("tui_file_isatty: bad magic number"); + internal_error (__FILE__, __LINE__, + "tui_file_isatty: bad magic number"); if (stream->ts_streamtype == afile) return (isatty (fileno (stream->ts_filestream))); else @@ -143,7 +145,8 @@ tui_file_rewind (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) - internal_error ("tui_file_rewind: bad magic number"); + internal_error (__FILE__, __LINE__, + "tui_file_rewind: bad magic number"); stream->ts_strbuf[0] = '\0'; } @@ -154,7 +157,8 @@ tui_file_put (struct ui_file *file, { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) - internal_error ("tui_file_put: bad magic number"); + internal_error (__FILE__, __LINE__, + "tui_file_put: bad magic number"); if (stream->ts_streamtype == astring) write (dest, stream->ts_strbuf, strlen (stream->ts_strbuf)); } @@ -240,7 +244,8 @@ tui_file_get_strbuf (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) - internal_error ("tui_file_get_strbuf: bad magic number"); + internal_error (__FILE__, __LINE__, + "tui_file_get_strbuf: bad magic number"); return (stream->ts_strbuf); } @@ -252,7 +257,8 @@ tui_file_adjust_strbuf (int n, struct ui_file *file) struct tui_stream *stream = ui_file_data (file); int non_null_chars; if (stream->ts_magic != &tui_file_magic) - internal_error ("tui_file_adjust_strbuf: bad magic number"); + internal_error (__FILE__, __LINE__, + "tui_file_adjust_strbuf: bad magic number"); if (stream->ts_streamtype != astring) return; @@ -278,7 +284,8 @@ tui_file_flush (struct ui_file *file) { struct tui_stream *stream = ui_file_data (file); if (stream->ts_magic != &tui_file_magic) - internal_error ("tui_file_flush: bad magic number"); + internal_error (__FILE__, __LINE__, + "tui_file_flush: bad magic number"); /* NOTE: cagney/1999-10-12: If we've been linked with code that uses fputs_unfiltered_hook then we assume that it doesn't need to know diff --git a/gdb/ui-file.c b/gdb/ui-file.c index 616cc5494c..81b7977fdb 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -1,5 +1,5 @@ /* UI_FILE - a generic STDIO like output stream. - Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -149,7 +149,8 @@ void * ui_file_data (struct ui_file *file) { if (file->magic != &ui_file_magic) - internal_error ("ui_file_data: bad magic number"); + internal_error (__FILE__, __LINE__, + "ui_file_data: bad magic number"); return file->to_data; } @@ -314,7 +315,8 @@ mem_file_delete (struct ui_file *file) { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) - internal_error ("mem_file_delete: bad magic number"); + internal_error (__FILE__, __LINE__, + "mem_file_delete: bad magic number"); if (stream->buffer != NULL) xfree (stream->buffer); xfree (stream); @@ -331,7 +333,8 @@ mem_file_rewind (struct ui_file *file) { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) - internal_error ("mem_file_rewind: bad magic number"); + internal_error (__FILE__, __LINE__, + "mem_file_rewind: bad magic number"); stream->length_buffer = 0; } @@ -342,7 +345,8 @@ mem_file_put (struct ui_file *file, { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) - internal_error ("mem_file_put: bad magic number"); + internal_error (__FILE__, __LINE__, + "mem_file_put: bad magic number"); if (stream->length_buffer > 0) write (dest, stream->buffer, stream->length_buffer); } @@ -354,7 +358,8 @@ mem_file_write (struct ui_file *file, { struct mem_file *stream = ui_file_data (file); if (stream->magic != &mem_file_magic) - internal_error ("mem_file_write: bad magic number"); + internal_error (__FILE__, __LINE__, + "mem_file_write: bad magic number"); if (stream->buffer == NULL) { stream->length_buffer = length_buffer; @@ -415,7 +420,8 @@ stdio_file_delete (struct ui_file *file) { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) - internal_error ("stdio_file_delete: bad magic number"); + internal_error (__FILE__, __LINE__, + "stdio_file_delete: bad magic number"); if (stdio->close_p) { fclose (stdio->file); @@ -428,7 +434,8 @@ stdio_file_flush (struct ui_file *file) { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) - internal_error ("stdio_file_flush: bad magic number"); + internal_error (__FILE__, __LINE__, + "stdio_file_flush: bad magic number"); fflush (stdio->file); } @@ -437,7 +444,8 @@ stdio_file_write (struct ui_file *file, const char *buf, long length_buf) { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) - internal_error ("stdio_file_write: bad magic number"); + internal_error (__FILE__, __LINE__, + "stdio_file_write: bad magic number"); fwrite (buf, length_buf, 1, stdio->file); } @@ -446,7 +454,8 @@ stdio_file_fputs (const char *linebuffer, struct ui_file *file) { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) - internal_error ("stdio_file_fputs: bad magic number"); + internal_error (__FILE__, __LINE__, + "stdio_file_fputs: bad magic number"); fputs (linebuffer, stdio->file); } @@ -455,7 +464,8 @@ stdio_file_isatty (struct ui_file *file) { struct stdio_file *stdio = ui_file_data (file); if (stdio->magic != &stdio_file_magic) - internal_error ("stdio_file_isatty: bad magic number"); + internal_error (__FILE__, __LINE__, + "stdio_file_isatty: bad magic number"); return (isatty (fileno (stdio->file))); } diff --git a/gdb/ui-out.c b/gdb/ui-out.c index 0d36639dd4..b6f9c7a720 100644 --- a/gdb/ui-out.c +++ b/gdb/ui-out.c @@ -1,5 +1,5 @@ /* Output generating routines for GDB. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Cygnus Solutions. Written by Fernando Nasser for Cygnus. @@ -190,7 +190,8 @@ void ui_out_table_begin (struct ui_out *uiout, int nbrofcols, char *tblid) { if (uiout->table_flag) - internal_error ("gdb/ui_out.c: tables cannot be nested; table_begin found before \ + internal_error (__FILE__, __LINE__, + "tables cannot be nested; table_begin found before \ previous table_end."); uiout->table_flag = 1; @@ -208,13 +209,16 @@ void ui_out_table_body (struct ui_out *uiout) { if (!uiout->table_flag) - internal_error ("gdb/ui_out.c: table_body outside a table is not valid; it must be \ + internal_error (__FILE__, __LINE__, + "table_body outside a table is not valid; it must be \ after a table_begin and before a table_end."); if (uiout->body_flag) - internal_error ("gdb/ui_out.c: extra table_body call not allowed; there must be \ + internal_error (__FILE__, __LINE__, + "extra table_body call not allowed; there must be \ only one table_body after a table_begin and before a table_end."); if (uiout->headercurr->colno != uiout->table_columns) - internal_error ("gdb/ui_out.c: number of headers differ from number of table \ + internal_error (__FILE__, __LINE__, + "number of headers differ from number of table \ columns."); uiout->body_flag = 1; @@ -227,7 +231,8 @@ void ui_out_table_end (struct ui_out *uiout) { if (!uiout->table_flag) - internal_error ("gdb/ui_out.c: misplaced table_end or missing table_begin."); + internal_error (__FILE__, __LINE__, + "misplaced table_end or missing table_begin."); uiout->body_flag = 0; uiout->table_flag = 0; @@ -244,7 +249,8 @@ ui_out_table_header (struct ui_out *uiout, int width, enum ui_align alignment, char *colhdr) { if (!uiout->table_flag || uiout->body_flag) - internal_error ("ui_out: table header must be specified after table_begin \ + internal_error (__FILE__, __LINE__, + "table header must be specified after table_begin \ and before table_body."); append_header_to_list (uiout, width, alignment, colhdr); @@ -256,10 +262,12 @@ void ui_out_list_begin (struct ui_out *uiout, char *lstid) { if (uiout->table_flag && !uiout->body_flag) - internal_error ("ui_out: table header or table_body expected; lists must be \ + internal_error (__FILE__, __LINE__, + "table header or table_body expected; lists must be \ specified after table_body."); if (uiout->list_flag >= 4) - internal_error ("ui_out: list depth exceeded; only 4 levels of lists can be \ + internal_error (__FILE__, __LINE__, + "list depth exceeded; only 4 levels of lists can be \ nested."); uiout->list_flag++; @@ -274,7 +282,8 @@ void ui_out_list_end (struct ui_out *uiout) { if (!uiout->list_flag) - internal_error ("ui_out: misplaced list_end; there is no list to be closed."); + internal_error (__FILE__, __LINE__, + "misplaced list_end; there is no list to be closed."); uo_list_end (uiout, uiout->list_flag); @@ -850,10 +859,12 @@ verify_field_proper_position (struct ui_out *uiout) if (uiout->table_flag) { if (!uiout->body_flag) - internal_error ("ui_out: table_body missing; table fields must be \ + internal_error (__FILE__, __LINE__, + "table_body missing; table fields must be \ specified after table_body and inside a list."); if (!uiout->list_flag) - internal_error ("ui_out: list_begin missing; table fields must be \ + internal_error (__FILE__, __LINE__, + "list_begin missing; table fields must be \ specified after table_body and inside a list."); } } @@ -873,7 +884,8 @@ verify_field_alignment (struct ui_out *uiout, && get_curr_header (uiout, &colno, width, align, &text)) { if (fldno != colno) - internal_error ("gdb/ui-out.c: ui-out internal error in handling headers."); + internal_error (__FILE__, __LINE__, + "ui-out internal error in handling headers."); } else { diff --git a/gdb/utils.c b/gdb/utils.c index 164bc9c164..0d2595a050 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -389,7 +389,8 @@ free_current_contents (void *ptr) { void **location = ptr; if (location == NULL) - internal_error ("free_current_contents: NULL pointer"); + internal_error (__FILE__, __LINE__, + "free_current_contents: NULL pointer"); if (*location != NULL) { xfree (*location); @@ -670,7 +671,8 @@ error_init (void) want to continue, dump core, or just exit. */ NORETURN void -internal_verror (const char *fmt, va_list ap) +internal_verror (const char *file, int line, + const char *fmt, va_list ap) { static char msg[] = "Internal GDB error: recursive internal error.\n"; static int dejavu = 0; @@ -695,7 +697,7 @@ internal_verror (const char *fmt, va_list ap) /* Try to get the message out */ target_terminal_ours (); - fputs_unfiltered ("gdb-internal-error: ", gdb_stderr); + fprintf_unfiltered (gdb_stderr, "%s:%d: gdb-internal-error: ", file, line); vfprintf_unfiltered (gdb_stderr, fmt, ap); fputs_unfiltered ("\n", gdb_stderr); @@ -731,12 +733,12 @@ Create a core file containing the current state of GDB? "); } NORETURN void -internal_error (char *string, ...) +internal_error (const char *file, int line, const char *string, ...) { va_list ap; va_start (ap, string); - internal_verror (string, ap); + internal_verror (file, line, string, ap); va_end (ap); } @@ -1002,11 +1004,13 @@ nomem (long size) { if (size > 0) { - internal_error ("virtual memory exhausted: can't allocate %ld bytes.", size); + internal_error (__FILE__, __LINE__, + "virtual memory exhausted: can't allocate %ld bytes.", size); } else { - internal_error ("virtual memory exhausted."); + internal_error (__FILE__, __LINE__, + "virtual memory exhausted."); } } @@ -1111,13 +1115,15 @@ xvasprintf (char **ret, const char *format, va_list ap) /* NULL could be returned due to a memory allocation problem; a badly format string; or something else. */ if ((*ret) == NULL) - internal_error ("%s:%d: vasprintf returned NULL buffer (errno %d)", - __FILE__, __LINE__, errno); + internal_error (__FILE__, __LINE__, + "vasprintf returned NULL buffer (errno %d)", + errno); /* A negative status with a non-NULL buffer shouldn't never happen. But to be sure. */ if (status < 0) - internal_error ("%s:%d: vasprintf call failed (errno %d)", - __FILE__, __LINE__, errno); + internal_error (__FILE__, __LINE__, + "vasprintf call failed (errno %d)", + errno); } @@ -2882,7 +2888,8 @@ CORE_ADDR host_pointer_to_address (void *ptr) { if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr)) - internal_error ("core_addr_to_void_ptr: bad cast"); + internal_error (__FILE__, __LINE__, + "core_addr_to_void_ptr: bad cast"); return POINTER_TO_ADDRESS (builtin_type_ptr, &ptr); } @@ -2891,7 +2898,8 @@ address_to_host_pointer (CORE_ADDR addr) { void *ptr; if (sizeof (ptr) != TYPE_LENGTH (builtin_type_ptr)) - internal_error ("core_addr_to_void_ptr: bad cast"); + internal_error (__FILE__, __LINE__, + "core_addr_to_void_ptr: bad cast"); ADDRESS_TO_POINTER (builtin_type_ptr, &ptr, addr); return ptr; } diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 81b27e5890..6e107404dd 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -1,5 +1,5 @@ /* Target-dependent code for the NEC V850 for GDB, the GNU debugger. - Copyright 1996, 2000 Free Software Foundation, Inc. + Copyright 1996, 2000, 2001 Free Software Foundation, Inc. This file is part of GDB. @@ -848,7 +848,8 @@ v850_target_architecture_hook (const bfd_arch_info_type *ap) } } - internal_error ("Architecture `%s' unrecognized", ap->printable_name); + internal_error (__FILE__, __LINE__, + "Architecture `%s' unrecognized", ap->printable_name); } void -- 2.34.1