+2020-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdb.dwarf2/dw2-inline-many-frames.exp (get_func_info): Delete.
+ * gdb.dwarf2/dw2-inline-small-func.exp: Pass options to
+ get_func_info.
+ (get_func_info): Delete.
+ * gdb.dwarf2/dw2-is-stmt-2.exp (get_func_info): Delete.
+ * gdb.dwarf2/dw2-is-stmt.exp (get_func_info): Delete.
+ * lib/dwarf.exp (get_func_info): New function.
+
2020-04-13 Tom de Vries <tdevries@suse.de>
* lib/ada.exp (find_ada_tool): Pass --GCC and -B to gnatlink, similar
standard_testfile dw2-inline-many-frames.c dw2-inline-many-frames.S
-# Extract the start, length, and end for function called NAME and
-# create suitable variables in the callers scope.
-proc get_func_info { name } {
- global srcdir subdir srcfile
-
- upvar 1 "${name}_start" func_start
- upvar 1 "${name}_len" func_len
- upvar 1 "${name}_end" func_end
-
- lassign [function_range ${name} [list ${srcdir}/${subdir}/$srcfile]] \
- func_start func_len
- set func_end "$func_start + $func_len"
-}
-
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
global srcdir subdir srcfile srcfile2
standard_testfile dw2-inline-small-func-lbls.c dw2-inline-small-func.S \
dw2-inline-small-func.c dw2-inline-small-func.h
-# Extract the start, length, and end for function called NAME and
-# create suitable variables in the callers scope.
-proc get_func_info { name } {
- global srcdir subdir srcfile
-
- upvar 1 "${name}_start" func_start
- upvar 1 "${name}_len" func_len
- upvar 1 "${name}_end" func_end
-
- lassign [function_range ${name} [list ${srcdir}/${subdir}/$srcfile] {debug optimize=-O1}] \
- func_start func_len
- set func_end "$func_start + $func_len"
-}
-
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
global srcdir subdir srcfile srcfile3 srcfile4
declare_labels lines_label callee_subprog_label
- get_func_info main
+ get_func_info main {debug optimize=-O1}
cu {} {
# It is important that the producer here be 'clang' as, at the
standard_testfile dw2-is-stmt-2.c dw2-is-stmt-2.S
-# Extract the start, length, and end for function called NAME and
-# create suitable variables in the callers scope.
-proc get_func_info { name } {
- global srcdir subdir srcfile
-
- upvar 1 "${name}_start" func_start
- upvar 1 "${name}_len" func_len
- upvar 1 "${name}_end" func_end
-
- lassign [function_range ${name} [list ${srcdir}/${subdir}/$srcfile]] \
- func_start func_len
- set func_end "$func_start + $func_len"
-}
-
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
global srcdir subdir srcfile
standard_testfile dw2-is-stmt.c dw2-is-stmt.S
-# Extract the start, length, and end for function called NAME and
-# create suitable variables in the callers scope.
-proc get_func_info { name } {
- global srcdir subdir srcfile
-
- upvar 1 "${name}_start" func_start
- upvar 1 "${name}_len" func_len
- upvar 1 "${name}_end" func_end
-
- lassign [function_range ${name} [list ${srcdir}/${subdir}/$srcfile]] \
- func_start func_len
- set func_end "$func_start + $func_len"
-}
-
set asm_file [standard_output_file $srcfile2]
Dwarf::assemble $asm_file {
global srcdir subdir srcfile
return [list "${func}_label - $func_label_offset" $func_length]
}
+# Extract the start, length, and end for function called NAME and
+# create suitable variables in the callers scope.
+proc get_func_info { name {options {debug}} } {
+ global srcdir subdir srcfile
+
+ upvar 1 "${name}_start" func_start
+ upvar 1 "${name}_len" func_len
+ upvar 1 "${name}_end" func_end
+
+ lassign [function_range ${name} \
+ [list ${srcdir}/${subdir}/$srcfile] \
+ ${options}] \
+ func_start func_len
+ set func_end "$func_start + $func_len"
+}
+
# A DWARF assembler.
#
# All the variables in this namespace are private to the