diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2007-11-25 21:40:39 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2007-11-25 21:40:39 +0000 |
commit | 4303944388ea72f96de9b1b662e45ac8f86cc741 (patch) | |
tree | 845139ad3874684f606283cb62b74826276352a7 /gdb/testsuite/gdb.dwarf2/dw2-ranges.exp | |
parent | a67d13cf51c964d13c60cbe9b59d6214ec5265a8 (diff) | |
download | gdb-4303944388ea72f96de9b1b662e45ac8f86cc741.zip gdb-4303944388ea72f96de9b1b662e45ac8f86cc741.tar.gz gdb-4303944388ea72f96de9b1b662e45ac8f86cc741.tar.bz2 |
gdb/
* dwarf2read.c (dwarf2_get_pc_bounds): Moved the `DW_AT_ranges' parsing
code with its variables OBJFILE, CU_HEADER and OBFD into ...
(dwarf2_ranges_read): ... a new function.
(read_partial_die): Implemented the parsing of `DW_AT_ranges'.
gdb/testsuite/
* gdb.dwarf2/dw2-ranges.S, gdb.dwarf2/dw2-ranges.exp: New files.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-ranges.exp')
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/dw2-ranges.exp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp new file mode 100644 index 0000000..4921551 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.exp @@ -0,0 +1,49 @@ +# Copyright 2007 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_compile_unit with no children and with neither DW_AT_low_pc nor +# DW_AT_high_pc but with DW_AT_ranges instead. + +# 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*]} { + verbose "Skipping DW_AT_ranges test." + return 0 +} + +set testfile "dw2-ranges" +set srcfile ${testfile}.S +set binfile ${objdir}/${subdir}/${testfile}.o + +if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object debug] != "" } { + return -1 +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +# Correct output: +# Line 39 of "../.././gdb/testsuite/gdb.dwarf2/dw2-ranges.S" starts at address 0x4 and ends at 0x8. +# Wrong output: +# No line number information available for address 0x4 + +gdb_test "info line func" "Line \[0-9\]* of .* starts at address .* and ends at .*" |