Blame SOURCES/gdb-bz568248-oom-is-error.patch

01917d
http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html
01917d
Subject: [rfc patch] nomem: internal_error -> error
01917d
01917d
Hi,
01917d
01917d
unfortunately I see this problem reproducible only with the
01917d
archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]).
01917d
OTOH this branch I hopefully submit in some form for FSF GDB later.
01917d
01917d
In this case (a general problem but tested for example on Fedora 13 i686):
01917d
01917d
int
01917d
main (int argc, char **argv)
01917d
{
01917d
  char a[argc];
01917d
  return a[0];
01917d
}
01917d
01917d
(gdb) start
01917d
(gdb) print a
01917d
../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes.
01917d
01917d
It is apparently because boundary for the variable `a' is not initialized
01917d
there.  Users notice it due to Eclipse-CDT trying to automatically display all
01917d
the local variables on each step.
01917d
01917d
01917d
Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
01917d
But is anone aware of the reasons to use internal_error there?
01917d
I find simple error as a perfectly reasonable there.
01917d
(history only tracks it since the initial import)
01917d
01917d
IIRC this idea has been discussed with Tom Tromey, not sure of its origin.
01917d
01917d
I understand it may be offtopic for FSF GDB but from some GDB crashes I am not
01917d
sure if it can happen only due to the VLA variables.
01917d
01917d
01917d
Thanks,
01917d
Jan
01917d
01917d
01917d
gdb/
01917d
2010-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
01917d
	    Tom Tromey  <tromey@redhat.com>
01917d
01917d
	* utils.c (nomem): Change internal_error to error.
01917d
01917d
Index: gdb-7.3.50.20110722/gdb/utils.c
01917d
===================================================================
01917d
--- gdb-7.3.50.20110722.orig/gdb/utils.c	2011-07-22 19:28:58.000000000 +0200
01917d
+++ gdb-7.3.50.20110722/gdb/utils.c	2011-07-22 19:34:25.000000000 +0200
01917d
@@ -1219,13 +1219,11 @@ malloc_failure (long size)
01917d
 {
01917d
   if (size > 0)
01917d
     {
01917d
-      internal_error (__FILE__, __LINE__,
01917d
-		      _("virtual memory exhausted: can't allocate %ld bytes."),
01917d
-		      size);
01917d
+      error (_("virtual memory exhausted: can't allocate %ld bytes."), size);
01917d
     }
01917d
   else
01917d
     {
01917d
-      internal_error (__FILE__, __LINE__, _("virtual memory exhausted."));
01917d
+      error (_("virtual memory exhausted."));
01917d
     }
01917d
 }
01917d