aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2016-07-13 13:58:19 +0200
committerJan Kratochvil <jan.kratochvil@redhat.com>2016-07-13 13:58:19 +0200
commite87324746c45b0f2cd179ba59a80b43a435a9369 (patch)
tree137271eec6797925e87017683b2d34dea1f9fff3 /gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
parent9873a9ab89ffbb9d794c6c68fa698cdf7a1d32da (diff)
downloadfsf-binutils-gdb-e87324746c45b0f2cd179ba59a80b43a435a9369.zip
fsf-binutils-gdb-e87324746c45b0f2cd179ba59a80b43a435a9369.tar.gz
fsf-binutils-gdb-e87324746c45b0f2cd179ba59a80b43a435a9369.tar.bz2
[ppc64] Fix for function descriptors
Marin Cermak has found various testcases (or one of them) of GDB FAIL on ppc64. https://sourceware.org/bugzilla/show_bug.cgi?id=20328 .o contained only the function descriptor address. The DWARF as produced by Tcl Dwarf::assemble: <1><27>: Abbrev Number: 4 (DW_TAG_subprogram) <28> DW_AT_name : main <2d> DW_AT_external : 1 <2e> DW_AT_low_pc : 0x1001ff98 <36> DW_AT_high_pc : 0x1002ff98 <2><3e>: Abbrev Number: 5 (DW_TAG_lexical_block) Runtime info: $2 = {<text variable, no debug info>} 0x10000674 <.main> $3 = {void ()} 0x1001ff98 <main> On Tue, 12 Jul 2016 15:22:49 +0200, Ulrich Weigand wrote: Well, most of the gdb.dwarf2 test cases simply use explicitly placed labels for the DW_AT_low_pc / DW_AT_high_pc attributes. See e.g. dw2-unresolved-main.c: asm (".globl cu_text_start"); asm ("cu_text_start:"); On Wed, 13 Jul 2016 10:54:00 +0200, Jan Kratochvil wrote: Now I see I should not do that because: lib/dwarf.exp: proc function_range { func src } { So I am providing this patch. gdb/testsuite/ChangeLog 2016-07-13 Jan Kratochvil <jan.kratochvil@redhat.com> * gdb.dwarf2/atomic-type.exp: Use function_range for low_pc and high_pc. * gdb.dwarf2/atomic.c (f): Rename f_end_lbl to f_label. * gdb.dwarf2/dw2-bad-mips-linkage-name.c (f): Rename f_end_lbl to f_label. (g): Rename g_end_lbl to g_label. * gdb.dwarf2/dw2-bad-mips-linkage-name.exp: Use function_range for low_pc and high_pc. * gdb.dwarf2/dw2-lexical-block-bare.exp: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp14
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp b/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
index 3f9411e..d09f56b 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-lexical-block-bare.exp
@@ -24,10 +24,16 @@ standard_testfile .S main.c
# Make some DWARF for the test.
set asm_file [standard_output_file $srcfile]
Dwarf::assemble $asm_file {
+ global srcdir subdir srcfile2
+
+ set main_result [function_range main ${srcdir}/${subdir}/${srcfile2}]
+ set main_start [lindex $main_result 0]
+ set main_length [lindex $main_result 1]
+
cu {} {
compile_unit {
- {low_pc [gdb_target_symbol main] DW_FORM_addr}
- {high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr}
+ {low_pc $main_start addr}
+ {high_pc "$main_start + $main_length" addr}
} {
declare_labels integer_label
@@ -40,8 +46,8 @@ Dwarf::assemble $asm_file {
DW_TAG_subprogram {
{name main}
{DW_AT_external 1 flag}
- {low_pc [gdb_target_symbol main] DW_FORM_addr}
- {high_pc [gdb_target_symbol main]+0x10000 DW_FORM_addr}
+ {low_pc $main_start addr}
+ {high_pc "$main_start + $main_length" addr}
} {
DW_TAG_lexical_block {
} {