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

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