diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-07-04 11:11:25 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@broadcom.com> | 2013-07-04 11:11:25 +0000 |
commit | 691a26f5ddd5f061ae8cd1be7c68212041da6ac2 (patch) | |
tree | 95b547fc6ca271d69f2947f9c7f0022aaa7a6225 /gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp | |
parent | a58e2656df4e2a614bc276159ef9b20368cdb8ca (diff) | |
download | gdb-691a26f5ddd5f061ae8cd1be7c68212041da6ac2.zip gdb-691a26f5ddd5f061ae8cd1be7c68212041da6ac2.tar.gz gdb-691a26f5ddd5f061ae8cd1be7c68212041da6ac2.tar.bz2 |
http://sourceware.org/ml/gdb-patches/2013-07/msg00059.html
gdb/ChangeLog
* stack.c (read_frame_arg): No longer fetch lazy values.
* value.c (value_optimized_out): If the value is not already
marked optimized out, and is lazy then fetch it.
(value_primitive_field): Move optimized out check to later in the
function, after we have loaded any lazy values.
(value_fetch_lazy): Use optimized out flag directly rather than
calling optimized_out method.
gdb/testsuite/ChangeLog
* gdb.dwarf2/dw2-reg-undefined.exp: New file.
* gdb.dwarf2/dw2-reg-undefined.c: Likewise.
* gdb.dwarf2/dw2-reg-undefined.S: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp')
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp b/gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp new file mode 100644 index 0000000..7b7b4d1 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-reg-undefined.exp @@ -0,0 +1,59 @@ +# Copyright 2013 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +load_lib dwarf.exp + +# This test can only be run on targets which support DWARF-2 and use gas. +if {![dwarf2_support]} { + return 0 +} + +# This test can only be run on x86_64 targets. +if {![istarget "x86_64-*-*"] || ![is_lp64_target]} { + return 0 +} + +standard_testfile .S + +if { [prepare_for_testing $testfile.exp $testfile $srcfile {nodebug}] } { + return -1 +} + +if ![runto stop_frame] { + perror "Failed to stop in stop_frame" + return -1 +} + +gdb_test "bt" "#0 (0x\[0-9a-f\]+ in )?stop_frame \[^\r\n\]*\r\n#1 \[^\r\n\]*first_frame \[^\r\n\]*\r\n#2 \[^\r\n\]*main\[^\r\n\]*" \ + "backtrace from stop_frame" + +set value_pattern "0x\[0-9a-f\]+\\s+\[0-9\]+" +set opt_out_pattern "\\*value not available\\*" + +for {set f 0} {$f < 3} {incr f} { + if {${f} == 0} { + set pattern_rax_rbx_rcx ${value_pattern} + set pattern_r8_r9 ${value_pattern} + } else { + set pattern_rax_rbx_rcx ${opt_out_pattern} + set pattern_r8_r9 ${value_pattern} + } + + # Select frame. + gdb_test "frame ${f}" "#${f}.*" "Switch to frame ${f}" + + # Display register values. + gdb_test "info registers rax rbx rcx r8 r9" "rax\\s+${pattern_rax_rbx_rcx}\\s*\r\nrbx\\s+${pattern_rax_rbx_rcx}\\s*\r\nrcx\\s+${pattern_rax_rbx_rcx}\\s*\r\nr8\\s+${pattern_r8_r9}\\s*\r\nr9\\s+${pattern_r8_r9}\\s*" \ + "Check values of rax, rbx, rcx, r8, r9 in frame ${f}" +} |