1 commit 51dab9e418741ac7065cd5a6ec9b57285e90227c
2 https://bugzilla.redhat.com/show_bug.cgi?id=738482
6 @@ -1981,6 +1981,10 @@ print_variable_and_value (const char *name, struct symbol *var,
7 struct value_print_options opts;
9 val = read_var_value (var, frame);
11 + make_cleanup_restore_selected_frame ();
12 + select_frame (frame);
14 get_user_print_options (&opts);
15 common_val_print (val, stream, indent, &opts, current_language);
18 +++ b/gdb/testsuite/gdb.base/vla-frame.c
20 +/* This testcase is part of GDB, the GNU debugger.
22 + Copyright 2011 Free Software Foundation, Inc.
24 + This program is free software; you can redistribute it and/or modify
25 + it under the terms of the GNU General Public License as published by
26 + the Free Software Foundation; either version 3 of the License, or
27 + (at your option) any later version.
29 + This program is distributed in the hope that it will be useful,
30 + but WITHOUT ANY WARRANTY; without even the implied warranty of
31 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 + GNU General Public License for more details.
34 + You should have received a copy of the GNU General Public License
35 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
40 +main (int argc, char **argv)
43 + void (*f) (char *) = 0;
45 + memset (s, 0, sizeof (s));
52 +++ b/gdb/testsuite/gdb.base/vla-frame.exp
54 +# Copyright 2011 Free Software Foundation, Inc.
56 +# This program is free software; you can redistribute it and/or modify
57 +# it under the terms of the GNU General Public License as published by
58 +# the Free Software Foundation; either version 3 of the License, or
59 +# (at your option) any later version.
61 +# This program is distributed in the hope that it will be useful,
62 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
63 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
64 +# GNU General Public License for more details.
66 +# You should have received a copy of the GNU General Public License
67 +# along with this program. If not, see <http://www.gnu.org/licenses/>.
69 +set testfile vla-frame
70 +set executable ${testfile}
72 +if { [prepare_for_testing ${testfile}.exp ${executable}] } {
81 +gdb_test_multiple $test $test {
82 + -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" {
85 + -re "\r\n$gdb_prompt $" {
86 + untested ${testfile}.exp
91 +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*"