diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-08-28 10:49:06 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2009-08-28 10:49:06 +0000 |
commit | d4b96c9a787ed13b0b9367b5fedb96a4746a5c9d (patch) | |
tree | faed0eb7803149e34aadfca246afe0f26431d60b /gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp | |
parent | 12b1a97932e2ae3112bbb389c81e4c80fff86c90 (diff) | |
download | gdb-d4b96c9a787ed13b0b9367b5fedb96a4746a5c9d.zip gdb-d4b96c9a787ed13b0b9367b5fedb96a4746a5c9d.tar.gz gdb-d4b96c9a787ed13b0b9367b5fedb96a4746a5c9d.tar.bz2 |
gdb/
Support constant DW_AT_data_member_location by GCC PR debug/40659.
* dwarf2read.c
(dwarf2_add_field <DW_TAG_member> <DW_AT_data_member_location>):
Initialize BYTE_OFFSET to 0 by default. Explicitly check if
attr_form_is_block.
(dwarf2_add_field <DW_TAG_inheritance> <DW_AT_data_member_location>)
(read_common_block <DW_AT_data_member_location>): New variable
byte_offset. Fix crash on non-DW_BLOCK ATTR values.
gdb/testsuite/
Support constant DW_AT_data_member_location by GCC PR debug/40659.
* gdb.dwarf2/dw2-inheritance.exp, gdb.dwarf2/dw2-inheritance.S: New.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp')
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp new file mode 100644 index 0000000..2eb5b46 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-inheritance.exp @@ -0,0 +1,40 @@ +# Copyright 2009 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/>. + +# Test DW_TAG_inheritance using constant DW_AT_data_member_location +# introduced by GCC PR debug/40659. + +# This test can only be run on targets which support DWARF-2 and use gas. +# For now pick a sampling of likely targets. +if {![istarget *-*-linux*] + && ![istarget *-*-gnu*] + && ![istarget *-*-elf*] + && ![istarget *-*-openbsd*] + && ![istarget arm-*-eabi*] + && ![istarget powerpc-*-eabi*]} { + return 0 +} + +set testfile "dw2-inheritance" +set srcfile ${testfile}.S +set executable ${testfile}.x + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${executable}" object {nodebug}] != "" } { + return -1 +} + +clean_restart $executable + +gdb_test "ptype inherited" "type = class inherited .*" |