+2020-11-06 Simon Marchi <simon.marchi@efficios.com>
+
+ * lib/dwarf.exp (ranges): Handle "base" and "range" as
+ proceduresu.
+ * gdb.dwarf/dw2-bad-elf.exp: Adjust.
+ * gdb.dwarf2/dw2-inline-many-frames.exp: Adjust.
+ * gdb.dwarf2/dw2-inline-stepping.exp: Adjust.
+ * gdb.dwarf2/dw2-ranges-base.exp: Adjust.
+ * gdb.dwarf2/dw2-ranges-func.exp: Adjust.
+ * gdb.dwarf2/dw2-ranges-overlap.exp: Adjust.
+ * gdb.dwarf2/dw2-ranges-psym.exp: Adjust.
+ * gdb.dwarf2/enqueued-cu-base-addr.exp: Adjust.
+
2020-11-04 Tom Tromey <tromey@adacore.com>
* gdb.ada/funcall_ref.exp: Update.
ranges {is_64 [is_64_target]} {
ranges_label_1: sequence {
- {base [lindex $main_result 0]}
- {range 0 [lindex $main_result 1]}
+ base [lindex $main_result 0]
+ range 0 [lindex $main_result 1]
}
ranges_label_2: sequence {
- {base some_func}
- {range 0 64}
+ base some_func
+ range 0 64
}
}
ranges {is_64 [is_64_target]} {
ranges_label: sequence {
- {range {${main_start}} ${main_end}}
- {range {${ddd_start}} ${ddd_end}}
- {range {${eee_start}} ${eee_end}}
- {range {${fff_start}} ${fff_end}}
- {range {${jjj_start}} ${jjj_end}}
- {range {${kkk_start}} ${kkk_end}}
+ range ${main_start} ${main_end}
+ range ${ddd_start} ${ddd_end}
+ range ${eee_start} ${eee_end}
+ range ${fff_start} ${fff_end}
+ range ${jjj_start} ${jjj_end}
+ range ${kkk_start} ${kkk_end}
}
}
}
ranges {is_64 [is_64_target]} {
ranges_label: sequence {
- {range {${main_start}} ${main_end}}
- {range {${bar_start}} ${bar_end}}
+ range ${main_start} ${main_end}
+ range ${bar_start} ${bar_end}
}
}
}
# base for each function.
ranges {is_64 [is_64_target]} {
ranges_label: sequence {
- {base [lindex $main_func 0]}
- {range 0 [lindex $main_func 1]}
- {base [lindex $frame2_func 0]}
- {range 0 [lindex $frame2_func 1]}
- {base [lindex $frame3_func 0]}
- {range 0 [lindex $frame3_func 1]}
+ base [lindex $main_func 0]
+ range 0 [lindex $main_func 1]
+ base [lindex $frame2_func 0]
+ range 0 [lindex $frame2_func 1]
+ base [lindex $frame3_func 0]
+ range 0 [lindex $frame3_func 1]
}
}
}
# Generate ranges data.
ranges {is_64 [is_64_target]} {
func_ranges_label: sequence {
- {range {$foo_start } $foo_end}
- {range {$foo_cold_start} $foo_cold_end}
+ range $foo_start $foo_end
+ range $foo_cold_start $foo_cold_end
}
cu_ranges_label: sequence {
- {range {$foo_start } $foo_end}
- {range {$foo_cold_start} $foo_cold_end}
- {range {$main_start} $main_end}
- {range {$bar_start} $bar_end}
- {range {$baz_start} $baz_end}
+ range $foo_start $foo_end
+ range $foo_cold_start $foo_cold_end
+ range $main_start $main_end
+ range $bar_start $bar_end
+ range $baz_start $baz_end
}
}
}
ranges {is_64 [is_64_target]} {
ranges_label: sequence {
- {base [lindex $main_func 0]}
- {range 0 [lindex $main_func 1]}
- {base [lindex $bar_func 0]}
- {range 0 [lindex $bar_func 1]}
+ base [lindex $main_func 0]
+ range 0 [lindex $main_func 1]
+ base [lindex $bar_func 0]
+ range 0 [lindex $bar_func 1]
}
}
}
# Generate ranges data.
ranges {is_64 [is_64_target]} {
func_ranges_label: sequence {
- {range {$foo_start } $foo_end}
- {range {$foo_low_start} $foo_low_end}
+ range $foo_start $foo_end
+ range $foo_low_start $foo_low_end
}
cu_ranges_label: sequence {
- {range {$foo_start } $foo_end}
- {range {$foo_low_start} $foo_low_end}
- {range {$bar_start} $bar_end}
- {range {$baz_start} $baz_end}
+ range $foo_start $foo_end
+ range $foo_low_start $foo_low_end
+ range $bar_start $bar_end
+ range $baz_start $baz_end
}
}
}
ranges {is_64 [is_64_target]} {
ranges_label: sequence {
- {range 0 [lindex $main_func 1]}
+ range 0 [lindex $main_func 1]
}
}
}
set section ".debug_ranges"
_section $section
- proc sequence {{ranges {}}} {
+ proc sequence { body } {
variable _debug_ranges_64_bit
# Emit the sequence of addresses.
- set base ""
- foreach range $ranges {
- set range [uplevel 1 "subst \"$range\""]
- set type [lindex $range 0]
- switch -exact -- $type {
- base {
- set base [lrange $range 1 end]
-
- if { $_debug_ranges_64_bit } then {
- _op .8byte 0xffffffffffffffff "Base Marker"
- _op .8byte $base "Base Address"
- } else {
- _op .4byte 0xffffffff "Base Marker"
- _op .4byte $base "Base Address"
- }
- }
- range {
- set start [lindex $range 1]
- set end [lrange $range 2 end]
-
- if { $_debug_ranges_64_bit } then {
- _op .8byte $start "Start Address"
- _op .8byte $end "End Address"
- } else {
- _op .4byte $start "Start Address"
- _op .4byte $end "End Address"
- }
- }
- default { error "unknown range type: $type " }
+
+ proc base { addr } {
+ variable _debug_ranges_64_bit
+
+ if { $_debug_ranges_64_bit } then {
+ _op .8byte 0xffffffffffffffff "Base Marker"
+ _op .8byte $addr "Base Address"
+ } else {
+ _op .4byte 0xffffffff "Base Marker"
+ _op .4byte $addr "Base Address"
}
}
+ proc range { start end } {
+ variable _debug_ranges_64_bit
+
+ if { $_debug_ranges_64_bit } then {
+ _op .8byte $start "Start Address"
+ _op .8byte $end "End Address"
+ } else {
+ _op .4byte $start "Start Address"
+ _op .4byte $end "End Address"
+ }
+ }
+
+ uplevel $body
+
# End of the sequence.
if { $_debug_ranges_64_bit } then {
_op .8byte 0x0 "End of Sequence Marker (Part 1)"