This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH RFC] abort() to internal_error()
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH RFC] abort() to internal_error()
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Tue, 20 Feb 2001 23:51:42 -0700
Andrew Cagney recently proposed replacing all calls to abort() with a
roughly equivalent call to internal_error(). In the brief discussion
that ensued, Michael Chastain and I were agreeable to Andrew's
proposal while J.T. Conklin suggested that different message be used
when internal_error() is called. Andrew agreed that J.T.'s suggested
error message was better and I noted that I had updated my script for
performing the transformations accordingly. Here is a list of the
messages which comprise the discussion to date:
http://sources.redhat.com/ml/gdb/2001-02/msg00211.html
http://sources.redhat.com/ml/gdb/2001-02/msg00212.html
http://sources.redhat.com/ml/gdb/2001-02/msg00215.html
http://sources.redhat.com/ml/gdb/2001-02/msg00229.html
http://sources.redhat.com/ml/gdb/2001-02/msg00232.html
http://sources.redhat.com/ml/gdb/2001-02/msg00234.html
http://sources.redhat.com/ml/gdb/2001-02/msg00238.html
Since the discussion seems to have died down, I hereby submit the
following patch for review. The concept behind this patch has already
been approved, so what remains to be seen is whether I have done a
reasonable job of implementing Andrew's proposal. As is often the
case for this sort of job, I used a Perl script to perform the
substitutions. I'll post the script as a reply to this message.
I have proofread the patch and have done a test build and testsuite
run on Linux/x86. No problems were found. I'll wait until the end
of the week for comments on this patch and commit it (assuming
no problems are found) over the weekend.
* buildsym.c (push_subfile, pop_subfile): Replace call to abort()
with call to internal_error().
* dbxread.c (process_one_symbol): Likewise.
* exec.c (build_section_table, xfer_memory): Likewise.
* h8500-tdep.c (h8500_register_size, h8500_register_virtual_type):
Likewise.
* hpread.c (hpread_type_translate, hpread_read_array_type,
hpread_type_lookup): Likewise.
* i386-tdep.c (gdb_print_insn_i386): Likewise.
* i960-tdep.c (mem): Likewise
* inflow.c (set_sigio_trap, clear_sigio_trap): Likewise.
* infptrace.c (child_resume): Likewise.
* infttrace.c (_initialize_infttrace): Likewise.
* language.c (binop_result_type, add_language): Likewise.
* lynx-nat.c (store_inferior_registers): Likewise.
* m3-nat.c (port_chain_insert, m3_trace_me): Likewise.
* mdebugread.c (parse_partial_symbols): Likewise.
* monitor.c (monitor_printf_noecho, monitor_printf,
monitor_dump_regs): Likewise.
* ocd.c (stu_put_packet): Likewise.
* printcmd.c (decode_format, print_scalar_formatted): Likewise.
* remote-bug.c (bug_open): Likewise.
* remote-e7000.c (fetch_regs_from_dump, e7000_wait): Likewise.
* remote-es.c (es1800_read_bytes): Likewise.
* remote-mips.c (common_breakpoint): Likewise.
* remote-rdp.c (send_rdp): Likewise.
* remote-sds.c (putmessage): Likewise.
* sparc-nat.c (fetch_inferior_registers, store_inferior_registers):
Likewise.
* sparcl-tdep.c (sparclite_download): Likewise.
* symtab.c (lookup_partial_symbol): Likewise.
* target.c (push_target, pop_target, initialize_targets): Likewise.
* utils.c (internal_verror, malloc_botch, wrap_here, decimal2str):
Likewise.
* valprint.c (print_decimal, print_longest, print_longest,
strcat_longest): Likewise.
* w65-tdep.c (init_frame_pc, w65_push_dummy_frame): Likewise.
* xmodem.c (xmodem_send_packet): Likewise.
* z8k-tdep.c (init_frame_pc, z8k_push_dummy_frame): Likewise.
* config/h8500/tm-h8500.h (STORE_STRUCT_RETURN): Likewise.
* config/mn10200/tm-mn10200.h (EXTRACT_RETURN_VALUE,
STORE_RETURN_VALUE): Likewise.
* config/ns32k/nm-umax.h (REGISTER_U_ADDR): Likewise.
* config/ns32k/xm-merlin.h (REGISTER_U_ADDR): Likewise.
* config/z8k/tm-z8k.h (STORE_STRUCT_RETURN, STORE_RETURN_VALUE):
Likewise.
Index: buildsym.c
===================================================================
RCS file: /cvs/src/src/gdb/buildsym.c,v
retrieving revision 1.7
diff -u -p -r1.7 buildsym.c
--- buildsym.c 2000/12/15 01:01:45 1.7
+++ buildsym.c 2001/02/21 05:41:32
@@ -667,7 +667,7 @@ push_subfile (void)
subfile_stack = tem;
if (current_subfile == NULL || current_subfile->name == NULL)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
tem->name = current_subfile->name;
}
@@ -680,7 +680,7 @@ pop_subfile (void)
if (link == NULL)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
name = link->name;
subfile_stack = link->next;
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.12
diff -u -p -r1.12 dbxread.c
--- dbxread.c 2001/01/19 14:53:44 1.12
+++ dbxread.c 2001/02/21 05:41:52
@@ -2202,7 +2202,7 @@ process_one_symbol (int type, int desc,
case N_ROSYM:
goto case_N_ROSYM;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
Index: exec.c
===================================================================
RCS file: /cvs/src/src/gdb/exec.c,v
retrieving revision 1.10
diff -u -p -r1.10 exec.c
--- exec.c 2001/01/27 00:43:25 1.10
+++ exec.c 2001/02/21 05:42:15
@@ -398,7 +398,7 @@ build_section_table (bfd *some_bfd, stru
*end = *start;
bfd_map_over_sections (some_bfd, add_to_section_table, (char *) end);
if (*end > *start + count)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
/* We could realloc the table, but it probably loses for most files. */
return 0;
}
@@ -488,7 +488,7 @@ xfer_memory (CORE_ADDR memaddr, char *my
asection *section;
if (len <= 0)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (overlay_debugging)
{
Index: h8500-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/h8500-tdep.c,v
retrieving revision 1.4
diff -u -p -r1.4 h8500-tdep.c
--- h8500-tdep.c 2000/12/15 01:01:47 1.4
+++ h8500-tdep.c 2001/02/21 05:42:38
@@ -251,7 +251,7 @@ h8500_register_size (int regno)
case PC_REGNUM:
return 4;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
@@ -286,7 +286,7 @@ h8500_register_virtual_type (int regno)
case PC_REGNUM:
return builtin_type_unsigned_long;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
Index: hpread.c
===================================================================
RCS file: /cvs/src/src/gdb/hpread.c,v
retrieving revision 1.7
diff -u -p -r1.7 hpread.c
--- hpread.c 2000/10/30 21:50:57 1.7
+++ hpread.c 2001/02/21 05:42:54
@@ -1074,7 +1074,7 @@ static int
hpread_type_translate (dnttpointer typep)
{
if (!typep.dntti.immediate)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
switch (typep.dntti.type)
{
@@ -1136,7 +1136,7 @@ hpread_type_translate (dnttpointer typep
case HP_TYPE_FTN_STRING_VAX_COMPAT:
return FT_STRING;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
@@ -1501,7 +1501,7 @@ hpread_read_array_type (dnttpointer hp_t
/* values are not normalized. */
if (!((dn_bufp->darray.arrayisbytes && dn_bufp->darray.elemisbytes)
|| (!dn_bufp->darray.arrayisbytes && !dn_bufp->darray.elemisbytes)))
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
else if (dn_bufp->darray.arraylength == 0x7fffffff)
{
/* The HP debug format represents char foo[]; as an array with
@@ -1618,7 +1618,7 @@ hpread_type_lookup (dnttpointer hp_type,
if (dn_bufp->dtype.type.dnttp.index < LNTT_SYMCOUNT (objfile))
dn_bufp = hpread_get_lntt (dn_bufp->dtype.type.dnttp.index, objfile);
else
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (dn_bufp->dblock.kind == DNTT_TYPE_STRUCT)
prefix = "struct ";
Index: i386-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i386-tdep.c,v
retrieving revision 1.17
diff -u -p -r1.17 i386-tdep.c
--- i386-tdep.c 2001/02/08 06:03:53 1.17
+++ i386-tdep.c 2001/02/21 05:42:58
@@ -947,7 +947,7 @@ gdb_print_insn_i386 (bfd_vma memaddr, di
return print_insn_i386_intel (memaddr, info);
/* Never reached - disassembly_flavour is always either att_flavor
or intel_flavor */
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/* If the disassembly mode is intel, we have to also switch the
Index: i960-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i960-tdep.c,v
retrieving revision 1.4
diff -u -p -r1.4 i960-tdep.c
--- i960-tdep.c 2000/09/07 19:27:15 1.4
+++ i960-tdep.c 2001/02/21 05:43:02
@@ -774,7 +774,7 @@ mem (unsigned long memaddr, unsigned lon
{
return len;
}
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/* Read the i960 instruction at 'memaddr' and return the address of
Index: inflow.c
===================================================================
RCS file: /cvs/src/src/gdb/inflow.c,v
retrieving revision 1.6
diff -u -p -r1.6 inflow.c
--- inflow.c 2001/02/14 16:57:29 1.6
+++ inflow.c 2001/02/21 05:43:09
@@ -679,14 +679,14 @@ void
set_sigio_trap (void)
{
if (target_activity_function)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
void
clear_sigio_trap (void)
{
if (target_activity_function)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#endif /* No SIGIO. */
Index: infptrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infptrace.c,v
retrieving revision 1.8
diff -u -p -r1.8 infptrace.c
--- infptrace.c 2001/02/08 06:03:53 1.8
+++ infptrace.c 2001/02/21 05:43:09
@@ -272,7 +272,7 @@ child_resume (int pid, int step, enum ta
if (step)
{
if (SOFTWARE_SINGLE_STEP_P)
- abort (); /* Make sure this doesn't happen. */
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Make sure this doesn't happen. */
else
ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
target_signal_to_host (signal));
Index: infttrace.c
===================================================================
RCS file: /cvs/src/src/gdb/infttrace.c,v
retrieving revision 1.7
diff -u -p -r1.7 infttrace.c
--- infttrace.c 2000/12/15 01:01:47 1.7
+++ infttrace.c 2001/02/21 05:43:20
@@ -5775,7 +5775,7 @@ _initialize_infttrace (void)
/* We do a lot of casts from pointers to TTRACE_ARG_TYPE; make sure
this is okay. */
if (sizeof (TTRACE_ARG_TYPE) < sizeof (void *))
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (errno || (memory_page_dictionary.page_size <= 0))
perror_with_name ("sysconf");
Index: language.c
===================================================================
RCS file: /cvs/src/src/gdb/language.c,v
retrieving revision 1.12
diff -u -p -r1.12 language.c
--- language.c 2001/02/08 06:03:53 1.12
+++ language.c 2001/02/21 05:43:26
@@ -571,7 +571,7 @@ binop_result_type (value_ptr v1, value_p
case language_chill:
error ("Missing Chill support in function binop_result_check."); /*FIXME */
}
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
return (struct type *) 0; /* For lint */
}
@@ -1384,7 +1384,7 @@ add_language (const struct language_defn
{
fprintf_unfiltered (gdb_stderr, "Magic number of %s language struct wrong\n",
lang->la_name);
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
if (!languages)
Index: lynx-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/lynx-nat.c,v
retrieving revision 1.4
diff -u -p -r1.4 lynx-nat.c
--- lynx-nat.c 2000/07/30 01:48:26 1.4
+++ lynx-nat.c 2001/02/21 05:43:33
@@ -410,7 +410,7 @@ store_inferior_registers (int regno)
if (regno == -1 || regno == SP_REGNUM)
{
if (!register_valid[L0_REGNUM + 5])
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp + FRAME_SAVED_I0,
®isters[REGISTER_BYTE (I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM));
@@ -422,7 +422,7 @@ store_inferior_registers (int regno)
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
{
if (!register_valid[regno])
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
+ FRAME_SAVED_L0;
Index: m3-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/m3-nat.c,v
retrieving revision 1.7
diff -u -p -r1.7 m3-nat.c
--- m3-nat.c 2001/02/08 06:03:53 1.7
+++ m3-nat.c 2001/02/21 05:43:38
@@ -346,7 +346,7 @@ port_chain_insert (port_chain_t list, ma
}
}
else
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
new = (port_chain_t) obstack_alloc (port_chain_obstack,
sizeof (struct port_chain));
@@ -602,17 +602,17 @@ m3_trace_me (void)
ret = task_get_bootstrap_port (mach_task_self (),
&original_server_port_name);
if (ret != KERN_SUCCESS)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
ret = mach_port_deallocate (mach_task_self (),
original_server_port_name);
if (ret != KERN_SUCCESS)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
/* Suspend this task to let the parent change my ports.
Resumed by the debugger */
ret = task_suspend (mach_task_self ());
if (ret != KERN_SUCCESS)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/*
Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.9
diff -u -p -r1.9 mdebugread.c
--- mdebugread.c 2000/12/15 01:01:48 1.9
+++ mdebugread.c 2001/02/21 05:43:55
@@ -2943,7 +2943,7 @@ parse_partial_symbols (struct objfile *o
CORE_ADDR svalue;
if (ext_ptr->ifd != f_idx)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
psh = &ext_ptr->asym;
/* Do not add undefined symbols to the partial symbol table. */
Index: monitor.c
===================================================================
RCS file: /cvs/src/src/gdb/monitor.c,v
retrieving revision 1.18
diff -u -p -r1.18 monitor.c
--- monitor.c 2001/02/02 19:14:32 1.18
+++ monitor.c 2001/02/21 05:44:07
@@ -335,7 +335,7 @@ monitor_printf_noecho (char *pattern,...
len = strlen (sndbuf);
if (len + 1 > sizeof sndbuf)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (monitor_debug_p)
{
@@ -363,7 +363,7 @@ monitor_printf (char *pattern,...)
len = strlen (sndbuf);
if (len + 1 > sizeof sndbuf)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (monitor_debug_p)
{
@@ -1286,7 +1286,7 @@ monitor_dump_regs (void)
parse_register_dump (buf, resp_len);
}
else
- abort (); /* Need some way to read registers */
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Need some way to read registers */
}
static void
Index: ocd.c
===================================================================
RCS file: /cvs/src/src/gdb/ocd.c,v
retrieving revision 1.11
diff -u -p -r1.11 ocd.c
--- ocd.c 2001/02/02 19:14:32 1.11
+++ ocd.c 2001/02/21 05:44:12
@@ -880,7 +880,7 @@ stu_put_packet (unsigned char *buf, int
unsigned char c;
if (len == 0 || len > 256)
- abort (); /* Can't represent 0 length packet */
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Can't represent 0 length packet */
reset_packet ();
Index: printcmd.c
===================================================================
RCS file: /cvs/src/src/gdb/printcmd.c,v
retrieving revision 1.14
diff -u -p -r1.14 printcmd.c
--- printcmd.c 2000/12/15 01:01:48 1.14
+++ printcmd.c 2001/02/21 05:44:26
@@ -249,7 +249,7 @@ decode_format (char **string_ptr, int of
val.size = osize ? 'h' : osize;
else
/* Bad value for TARGET_PTR_BIT */
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
break;
case 'f':
/* Floating point has to be word or giantword. */
@@ -456,7 +456,7 @@ print_scalar_formatted (char *valaddr, s
break;
case 0:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
case 't':
/* Binary; 't' stands for "two". */
Index: remote-bug.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-bug.c,v
retrieving revision 1.12
diff -u -p -r1.12 remote-bug.c
--- remote-bug.c 2001/02/02 23:04:14 1.12
+++ remote-bug.c 2001/02/21 05:44:38
@@ -226,7 +226,7 @@ bug_open (char *args, int from_tty)
target_is_m88110 = 1;
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
Index: remote-e7000.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-e7000.c,v
retrieving revision 1.14
diff -u -p -r1.14 remote-e7000.c
--- remote-e7000.c 2001/02/02 23:04:14 1.14
+++ remote-e7000.c 2001/02/21 05:44:40
@@ -887,7 +887,7 @@ fetch_regs_from_dump (int (*nextchar) ()
}
else
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
store_signed_integer (buf,
REGISTER_RAW_SIZE (regno),
@@ -2117,7 +2117,7 @@ e7000_wait (int pid, struct target_waits
break;
default:
/* Get the user's attention - this should never happen. */
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
return 0;
Index: remote-es.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-es.c,v
retrieving revision 1.11
diff -u -p -r1.11 remote-es.c
--- remote-es.c 2001/02/02 19:14:33 1.11
+++ remote-es.c 2001/02/21 05:44:42
@@ -1031,7 +1031,7 @@ es1800_read_bytes (CORE_ADDR memaddr, ch
if (len > PBUFSIZ / 2 - 1)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
if (len == 1) /* The emulator does not like expressions like: */
Index: remote-mips.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-mips.c,v
retrieving revision 1.16
diff -u -p -r1.16 remote-mips.c
--- remote-mips.c 2001/02/08 06:03:53 1.16
+++ remote-mips.c 2001/02/21 05:44:47
@@ -2729,7 +2729,7 @@ common_breakpoint (int set, CORE_ADDR ad
flags = "f";
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
cmd = 'B';
Index: remote-rdp.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-rdp.c,v
retrieving revision 1.10
diff -u -p -r1.10 remote-rdp.c
--- remote-rdp.c 2001/02/02 19:14:33 1.10
+++ remote-rdp.c 2001/02/21 05:44:53
@@ -471,13 +471,13 @@ send_rdp (char *template,...)
*pi = get_byte ();
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
va_end (alist);
if (dst != buf)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
Index: remote-sds.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-sds.c,v
retrieving revision 1.11
diff -u -p -r1.11 remote-sds.c
--- remote-sds.c 2001/02/02 19:14:33 1.11
+++ remote-sds.c 2001/02/21 05:44:54
@@ -746,7 +746,7 @@ putmessage (unsigned char *buf, int len)
and giving it a checksum. */
if (len > 170) /* Prosanity check */
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (remote_debug)
{
Index: sparc-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/sparc-nat.c,v
retrieving revision 1.4
diff -u -p -r1.4 sparc-nat.c
--- sparc-nat.c 2000/10/23 03:21:06 1.4
+++ sparc-nat.c 2001/02/21 05:45:29
@@ -59,7 +59,7 @@ fetch_inferior_registers (int regno)
/* We should never be called with deferred stores, because a prerequisite
for writing regs is to have fetched them all (PREPARE_TO_STORE), sigh. */
if (deferred_stores)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
DO_DEFERRED_STORES;
@@ -195,7 +195,7 @@ store_inferior_registers (int regno)
if (regno < 0 || regno == SP_REGNUM)
{
if (!register_valid[L0_REGNUM + 5])
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp,
®isters[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
@@ -203,7 +203,7 @@ store_inferior_registers (int regno)
else
{
if (!register_valid[regno])
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
®isters[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno));
@@ -214,7 +214,7 @@ store_inferior_registers (int regno)
if (wanna_store & INT_REGS)
{
if (!register_valid[G1_REGNUM])
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)],
15 * REGISTER_RAW_SIZE (G1_REGNUM));
@@ -236,7 +236,7 @@ store_inferior_registers (int regno)
if (wanna_store & FP_REGS)
{
if (!register_valid[FP0_REGNUM + 9])
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.fpu_fr);
memcpy (&inferior_fp_registers.Fpu_fsr,
Index: sparcl-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/sparcl-tdep.c,v
retrieving revision 1.9
diff -u -p -r1.9 sparcl-tdep.c
--- sparcl-tdep.c 2001/01/31 01:24:02 1.9
+++ sparcl-tdep.c 2001/02/21 05:45:35
@@ -836,7 +836,7 @@ sparclite_download (char *filename, int
download (remote_target_name, filename, from_tty, sparclite_udp_write,
sparclite_udp_start);
#else
- abort (); /* sparclite_open should prevent this! */
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* sparclite_open should prevent this! */
#endif
else
download (remote_target_name, filename, from_tty, sparclite_serial_write,
Index: symtab.c
===================================================================
RCS file: /cvs/src/src/gdb/symtab.c,v
retrieving revision 1.29
diff -u -p -r1.29 symtab.c
--- symtab.c 2001/02/20 00:09:01 1.29
+++ symtab.c 2001/02/21 05:45:55
@@ -998,7 +998,7 @@ lookup_partial_symbol (struct partial_sy
{
center = bottom + (top - bottom) / 2;
if (!(center < top))
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (!do_linear_search
&& (SYMBOL_LANGUAGE (*center) == language_java))
{
@@ -1014,7 +1014,7 @@ lookup_partial_symbol (struct partial_sy
}
}
if (!(top == bottom))
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
/* djb - 2000-06-03 - Use SYMBOL_MATCHES_NAME, not a strcmp, so
we don't have to force a linear search on C++. Probably holds true
Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.19
diff -u -p -r1.19 target.c
--- target.c 2001/01/26 02:30:15 1.19
+++ target.c 2001/02/21 05:45:59
@@ -641,7 +641,7 @@ push_target (struct target_ops *t)
fprintf_unfiltered (gdb_stderr,
"Magic number of %s target struct wrong\n",
t->to_shortname);
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/* Find the proper stratum to install this target in. */
@@ -737,7 +737,7 @@ pop_target (void)
fprintf_unfiltered (gdb_stderr,
"pop_target couldn't find target %s\n",
current_target.to_shortname);
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#undef MIN
@@ -2993,5 +2993,5 @@ When non-zero, target debugging is enabl
target_dcache = dcache_init();
if (!STREQ (signals[TARGET_SIGNAL_LAST].string, "TARGET_SIGNAL_MAGIC"))
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
Index: utils.c
===================================================================
RCS file: /cvs/src/src/gdb/utils.c,v
retrieving revision 1.30
diff -u -p -r1.30 utils.c
--- utils.c 2001/02/08 06:03:54 1.30
+++ utils.c 2001/02/21 05:46:14
@@ -688,7 +688,7 @@ internal_verror (const char *file, int l
case 1:
dejavu = 2;
fputs_unfiltered (msg, gdb_stderr);
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
default:
dejavu = 3;
write (STDERR_FILENO, msg, sizeof (msg));
@@ -717,13 +717,13 @@ Create a core file containing the curren
if (dump_core_p)
{
if (fork () == 0)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
else
{
if (dump_core_p)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
else
exit (1);
}
@@ -955,7 +955,7 @@ static void
malloc_botch (void)
{
fprintf_unfiltered (gdb_stderr, "Memory corruption\n");
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/* Attempt to install hooks in mmalloc/mrealloc/mfree for the heap specified
@@ -1692,7 +1692,7 @@ wrap_here (char *indent)
{
/* This should have been allocated, but be paranoid anyway. */
if (!wrap_buffer)
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (wrap_buffer[0])
{
@@ -2802,7 +2802,7 @@ decimal2str (char *paddr_str, char *sign
sign, temp[2], temp[1], temp[0]);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
}
Index: valprint.c
===================================================================
RCS file: /cvs/src/src/gdb/valprint.c,v
retrieving revision 1.9
diff -u -p -r1.9 valprint.c
--- valprint.c 2000/12/15 01:01:50 1.9
+++ valprint.c 2001/02/21 05:46:23
@@ -257,7 +257,7 @@ print_decimal (struct ui_file *stream, c
sign, temp[2], temp[1], temp[0]);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
return;
}
@@ -360,7 +360,7 @@ print_longest (struct ui_file *stream, i
fprintf_filtered (stream, local_hex_format_custom ("016ll"), val_long);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#else /* !CC_HAS_LONG_LONG || !PRINTF_HAS_LONG_LONG */
/* In the following it is important to coerce (val_long) to a long. It does
@@ -407,7 +407,7 @@ print_longest (struct ui_file *stream, i
(unsigned long) val_long);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#endif /* CC_HAS_LONG_LONG || PRINTF_HAS_LONG_LONG */
}
@@ -467,7 +467,7 @@ strcat_longest (int format, int use_loca
sprintf (buf, local_hex_format_custom ("016ll"), val_long);
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#else /* !PRINTF_HAS_LONG_LONG */
/* In the following it is important to coerce (val_long) to a long. It does
@@ -508,7 +508,7 @@ strcat_longest (int format, int use_loca
((long) val_long));
break;
default:
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
#endif /* !PRINTF_HAS_LONG_LONG */
Index: w65-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/w65-tdep.c,v
retrieving revision 1.2
diff -u -p -r1.2 w65-tdep.c
--- w65-tdep.c 2000/07/30 01:48:28 1.2
+++ w65-tdep.c 2001/02/21 05:46:29
@@ -54,13 +54,13 @@ read_memory_pointer (CORE_ADDR x)
init_frame_pc (void)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
void
w65_push_dummy_frame (void)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/* Put here the code to store, into a struct frame_saved_regs,
Index: xmodem.c
===================================================================
RCS file: /cvs/src/src/gdb/xmodem.c,v
retrieving revision 1.2
diff -u -p -r1.2 xmodem.c
--- xmodem.c 2000/07/30 01:48:28 1.2
+++ xmodem.c 2001/02/21 05:46:37
@@ -185,7 +185,7 @@ xmodem_send_packet (serial_t desc, unsig
datasize = XMODEM_1KDATASIZE;
}
else
- abort (); /* Packet way too large */
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); /* Packet way too large */
/* Add ^Z padding if packet < 128 (or 1024) bytes */
Index: z8k-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/z8k-tdep.c,v
retrieving revision 1.3
diff -u -p -r1.3 z8k-tdep.c
--- z8k-tdep.c 2000/07/30 01:48:28 1.3
+++ z8k-tdep.c 2001/02/21 05:46:37
@@ -171,7 +171,7 @@ z8k_frame_chain (struct frame_info *this
void
init_frame_pc (void)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
/* Put here the code to store, into a struct frame_saved_regs,
@@ -197,7 +197,7 @@ z8k_frame_init_saved_regs (struct frame_
void
z8k_push_dummy_frame (void)
{
- abort ();
+ internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
int
Index: config/h8500/tm-h8500.h
===================================================================
RCS file: /cvs/src/src/gdb/config/h8500/tm-h8500.h,v
retrieving revision 1.3
diff -u -p -r1.3 tm-h8500.h
--- tm-h8500.h 2000/05/28 01:12:35 1.3
+++ tm-h8500.h 2001/02/21 05:46:48
@@ -159,7 +159,7 @@ extern struct type *h8500_register_virtu
subroutine will return. This is called from call_function. */
/*#define STORE_STRUCT_RETURN(ADDR, SP) \
- { write_register (0, (ADDR)); abort(); } */
+ { write_register (0, (ADDR)); internal_error (__FILE__, __LINE__, "failed internal consistency check"); } */
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
Index: config/mn10200/tm-mn10200.h
===================================================================
RCS file: /cvs/src/src/gdb/config/mn10200/tm-mn10200.h,v
retrieving revision 1.2
diff -u -p -r1.2 tm-mn10200.h
--- tm-mn10200.h 2000/05/28 01:12:36 1.2
+++ tm-mn10200.h 2001/02/21 05:46:59
@@ -122,7 +122,7 @@ extern CORE_ADDR mn10200_frame_saved_pc
#define EXTRACT_RETURN_VALUE(TYPE, REGBUF, VALBUF) \
{ \
if (TYPE_LENGTH (TYPE) > 8) \
- abort (); \
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
else if (TYPE_LENGTH (TYPE) > 2 && TYPE_CODE (TYPE) != TYPE_CODE_PTR) \
{ \
memcpy (VALBUF, REGBUF + REGISTER_BYTE (0), 2); \
@@ -145,7 +145,7 @@ extern CORE_ADDR mn10200_frame_saved_pc
#define STORE_RETURN_VALUE(TYPE, VALBUF) \
{ \
if (TYPE_LENGTH (TYPE) > 8) \
- abort (); \
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
else if (TYPE_LENGTH (TYPE) > 2 && TYPE_CODE (TYPE) != TYPE_CODE_PTR) \
{ \
write_register_bytes (REGISTER_BYTE (0), VALBUF, 2); \
Index: config/ns32k/nm-umax.h
===================================================================
RCS file: /cvs/src/src/gdb/config/ns32k/nm-umax.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 nm-umax.h
--- nm-umax.h 1999/07/07 20:16:03 1.1.1.2
+++ nm-umax.h 2001/02/21 05:46:59
@@ -50,6 +50,6 @@
addr = PU_F0 + (regno - LP0_REGNUM) * sizeof (double); break; \
default: \
printf ("bad argument to REGISTER_U_ADDR %d\n", regno); \
- abort (); \
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
} \
}
Index: config/ns32k/xm-merlin.h
===================================================================
RCS file: /cvs/src/src/gdb/config/ns32k/xm-merlin.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 xm-merlin.h
--- xm-merlin.h 1999/07/07 20:16:10 1.1.1.2
+++ xm-merlin.h 2001/02/21 05:47:00
@@ -61,6 +61,6 @@
addr = 76 + (regno - LP0_REGNUM) * sizeof (double); break; \
default: \
printf ("bad argument to REGISTER_U_ADDR %d\n", regno); \
- abort (); \
+ internal_error (__FILE__, __LINE__, "failed internal consistency check"); \
} \
}
Index: config/z8k/tm-z8k.h
===================================================================
RCS file: /cvs/src/src/gdb/config/z8k/tm-z8k.h,v
retrieving revision 1.3
diff -u -p -r1.3 tm-z8k.h
--- tm-z8k.h 2000/05/28 01:12:42 1.3
+++ tm-z8k.h 2001/02/21 05:47:08
@@ -138,7 +138,7 @@ extern int z8k_saved_pc_after_call (stru
/* Store the address of the place in which to copy the structure the
subroutine will return. This is called from call_function. */
-#define STORE_STRUCT_RETURN(ADDR, SP) abort();
+#define STORE_STRUCT_RETURN(ADDR, SP) internal_error (__FILE__, __LINE__, "failed internal consistency check");
/* Extract from an array REGBUF containing the (raw) register state
a function return value of type TYPE, and copy that, in virtual format,
@@ -152,7 +152,7 @@ extern int z8k_saved_pc_after_call (stru
/* Write into appropriate registers a function return value
of type TYPE, given in virtual format. */
-#define STORE_RETURN_VALUE(TYPE,VALBUF) abort();
+#define STORE_RETURN_VALUE(TYPE,VALBUF) internal_error (__FILE__, __LINE__, "failed internal consistency check");
/* Extract from an array REGBUF containing the (raw) register state
the address in which a function should return its structure value,