binutils-gdb/gdb/testsuite/gdb.cell/dwarfaddr.exp

54 lines
1.6 KiB
Plaintext
Raw Normal View History

# Copyright 2010-2013 Free Software Foundation, Inc.
ChangeLog: * dwarf2expr.h (struct dwarf_value_location): Use ULONGEST as type of stack values. (struct dwarf_expr_piece): Rename "expr" member to "mem". Add new "value" member. (dwarf_expr_push): Change input type to ULONGEST. (dwarf_expr_fetch): Change return type to ULONGEST. (dwarf_expr_fetch_address): Add prototype. (dwarf2_read_address): Remove prototype. * dwarf2expr.c (dwarf_expr_push): Use ULONGEST as type of stack values. Truncate stack values to ctx->addr_size bytes. (dwarf_expr_fetch): Change return value to ULONGEST. (dwarf_expr_fetch_address): New function. (add_piece): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. Update for struct dwarf_expr_piece changes. (dwarf2_read_address): Remove. (unsigned_address_type): Remove. (signed_address_type): Remove. (execute_stack_op): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. Use ULONGEST as type of stack values. Perform operations on ULONGEST instead of on GDB values, sign-extending from ctx->addr_size bytes as needed. Read DW_OP_addr values and DW_OP_deref results as unsigned integers. * dwarf2loc.c (read_pieced_value): Update for struct dwarf_expr_piece changes. (write_pieced_value): Likewise. (dwarf2_evaluate_loc_desc): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. (compile_dwarf_to_ax): Read DW_OP_addr values as unsigned integers. * dwarf2-frame.c (execute_stack_op): Use dwarf_expr_fetch_address instead of dwarf_expr_fetch when appropriate. testsuite/ChangeLog: * gdb.cell/dwarfaddr.exp: New file. * gdb.cell/dwarfaddr.S: New file.
2010-06-25 15:00:33 +02:00
#
# 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/>.
#
# This file is part of the gdb testsuite.
#
# Contributed by Ulrich Weigand <uweigand@de.ibm.com>.
# Tests for SPU addresses resulting from complex DWARF expressions.
load_lib cell.exp
set testfile "dwarfaddr"
set srcfile ${srcdir}/${subdir}/${testfile}.S
set binary ${objdir}/${subdir}/${testfile}
if {[skip_cell_tests]} {
return 0
}
# Compile SPU binary.
if { [gdb_compile_cell_spu $srcfile $binary executable {debug}] != "" } {
unsupported "Compiling spu binary failed."
return -1
}
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binary}
if ![runto_main] then {
fail "Can't run to main"
return 0
}
gdb_test "print x" " = \\{0 <repeats 16 times>\\}" "print x"
gdb_test "print &x" " = \\(int \\(\\*\\)\\\[16\\\]\\) 0x\[0-9a-f\]*" "print &x"
gdb_test "info address x" "Symbol \"x\" is a complex DWARF expression.*DW_OP_and\[\r\n\]+\." "info address x"
gdb_exit
return 0