]>
Commit | Line | Data |
---|---|---|
51a5ef0f PS |
1 | http://sourceware.org/ml/gdb-patches/2010-06/msg00005.html |
2 | Subject: [rfc patch] nomem: internal_error -> error | |
3 | ||
4 | Hi, | |
5 | ||
6 | unfortunately I see this problem reproducible only with the | |
7 | archer-jankratochvil-vla branch (VLA = Variable Length Arrays - char[var]). | |
8 | OTOH this branch I hopefully submit in some form for FSF GDB later. | |
9 | ||
10 | In this case (a general problem but tested for example on Fedora 13 i686): | |
11 | ||
12 | int | |
13 | main (int argc, char **argv) | |
14 | { | |
15 | char a[argc]; | |
16 | return a[0]; | |
17 | } | |
18 | ||
19 | (gdb) start | |
20 | (gdb) print a | |
21 | ../../gdb/utils.c:1251: internal-error: virtual memory exhausted: can't allocate 4294951689 bytes. | |
22 | ||
23 | It is apparently because boundary for the variable `a' is not initialized | |
24 | there. Users notice it due to Eclipse-CDT trying to automatically display all | |
25 | the local variables on each step. | |
26 | ||
27 | ||
28 | Apparentl no regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu. | |
29 | But is anone aware of the reasons to use internal_error there? | |
30 | I find simple error as a perfectly reasonable there. | |
31 | (history only tracks it since the initial import) | |
32 | ||
33 | IIRC this idea has been discussed with Tom Tromey, not sure of its origin. | |
34 | ||
35 | I understand it may be offtopic for FSF GDB but from some GDB crashes I am not | |
36 | sure if it can happen only due to the VLA variables. | |
37 | ||
38 | ||
39 | Thanks, | |
40 | Jan | |
41 | ||
42 | ||
43 | gdb/ | |
44 | 2010-06-01 Jan Kratochvil <jan.kratochvil@redhat.com> | |
45 | Tom Tromey <tromey@redhat.com> | |
46 | ||
47 | * utils.c (nomem): Change internal_error to error. | |
48 | ||
f412e1b4 PS |
49 | Index: gdb-7.3.50.20110722/gdb/utils.c |
50 | =================================================================== | |
51 | --- gdb-7.3.50.20110722.orig/gdb/utils.c 2011-07-22 19:28:58.000000000 +0200 | |
52 | +++ gdb-7.3.50.20110722/gdb/utils.c 2011-07-22 19:34:25.000000000 +0200 | |
53 | @@ -1219,13 +1219,11 @@ malloc_failure (long size) | |
51a5ef0f PS |
54 | { |
55 | if (size > 0) | |
f412e1b4 | 56 | { |
51a5ef0f PS |
57 | - internal_error (__FILE__, __LINE__, |
58 | - _("virtual memory exhausted: can't allocate %ld bytes."), | |
59 | - size); | |
f412e1b4 PS |
60 | + error (_("virtual memory exhausted: can't allocate %ld bytes."), size); |
61 | } | |
51a5ef0f | 62 | else |
f412e1b4 | 63 | { |
51a5ef0f | 64 | - internal_error (__FILE__, __LINE__, _("virtual memory exhausted.")); |
f412e1b4 PS |
65 | + error (_("virtual memory exhausted.")); |
66 | } | |
51a5ef0f PS |
67 | } |
68 |