This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] solib-display.exp: displays for local variables automatically disabled
- From: Xingxing Pan <forandom at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 8 Nov 2010 21:19:18 +0800
- Subject: [patch] solib-display.exp: displays for local variables automatically disabled
FAIL: gdb.base/solib-display.exp: NO: continue
FAIL: gdb.base/solib-display.exp: IN: continue
FAIL: gdb.base/solib-display.exp: SEP: continue
Breakpoint 4, bar () at gdb/testsuite/gdb.base/solib-display-main.c:25^M
25 return main_global + a_local + a_static; /* break here */^M
3: c_global = 43^M
1: a_global = 41^M
(gdb) PASS: gdb.base/solib-display.exp: NO: continue
display main_global^M
4: main_global = 44^M
(gdb) PASS: gdb.base/solib-display.exp: NO: display main_global
display a_local^M
5: a_local = 45^M
(gdb) PASS: gdb.base/solib-display.exp: NO: display a_local
display a_static^M
6: a_static = 46^M
(gdb) PASS: gdb.base/solib-display.exp: NO: display a_static
start ^M
The program being debugged has been started already.^M
Start it from the beginning? (y or n) y^M
Temporary breakpoint 5 at 0x20005e0: file gdb/testsuite/gdb.base/solib-display-
main.c, line 30.^M
Starting program: gdb/testsuite/gdb.base/solib-display-main ^M
^M
Breakpoint 1, main () at gdb/testsuite/gdb.base/solib-
display-main.c:30^M30 bar ();^M
warning: Unable to display "a_static": No symbol "a_static" in current
context.^M
warning: Unable to display "a_local": No symbol "a_local" in current context.^M
4: main_global = 44^M
3: c_global = 43^M
1: a_global = 41^M
(gdb) break 25^M
Note: breakpoint 4 also set at pc 0x20005a0.^M
Breakpoint 6 at 0x20005a0: file
gdb/testsuite/gdb.base/solib-display-main.c, line
25.^M
(gdb) PASS: gdb.base/solib-display.exp: NO: break 25
continue^M
Continuing.^M
^M
Breakpoint 4, bar () at gdb/testsuite/gdb.base/solib-display-main.c:25^M
25 return main_global + a_local + a_static; /* break here */^M
4: main_global = 44^M
3: c_global = 43^M
1: a_global = 41^M
(gdb) FAIL: gdb.base/solib-display.exp: NO: continue
solib-display-main.c:
extern int foo ();
int main_global = 44;
int bar ()
{
int a_local = 45;
static int a_static = 46;
return main_global + a_local + a_static; /* break here */
}
int main ()
{
bar ();
return foo ();
}
After restart to main, the display expressions for A_LOCAL and A_STATIC were
disabled automatically because of out of scope (which is different
from gdb-6.8).
we need to enable them.
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-08 Pan Xingxing <panxingxing@mprc.pku.edu.cn>
+
+ * gdb.base/solib-display.exp: Add 'enable display'
+ when display expressions for local variables are
+ disabled automatically because of out of scope.
+
2010-11-05 Doug Evans <dje@google.com>
* gdb.base/help.exp: Update expected output.
--- a/gdb/testsuite/gdb.base/solib-display.exp
+++ b/gdb/testsuite/gdb.base/solib-display.exp
@@ -132,6 +132,8 @@ foreach libsepdebug {NO IN SEP} {
}
gdb_test "" "6: a_static = 46\\r\\n4: main_global = 44\\r\\n.*"
+ gdb_test "enable display 5"
+ gdb_test "enable display 6"
gdb_test "break [gdb_get_line_number "break here" ${testfile}.c]" \
".*Breakpoint.* at .*"
gdb_test "continue" "6: a_static = 46\\r\\n5: a_local =
45\\r\\n4: main_global
= 44\\r\\n.*"