Since commit
52b920c5d20 ("[gdb/testsuite] Fix gdb.dwarf2/dw2-dir-file-name.exp
for ppc64le"), the test-case fails with target board cc-with-debug-names, due
to missing .debug_aranges info.
Add the missing .debug_aranges info.
Also add a file_id option to Dwarf::assemble, to make it possible to contribute
to an already open file.
Tested on x86_64-linux.
"
out_compdir out_cu
+Dwarf::assemble { add_dummy_cus 0 file_id $f } {
+ global func_info_names
+
+ foreach name $func_info_names {
+ global ${name}_start
+ global ${name}_end
+ set name_start [set ${name}_start]
+ set name_end [set ${name}_end]
+
+ set cu_label .L${name}_begin
+ aranges {} cu_label {
+ arange {} $name_start "$name_end - $name_start"
+ }
+ }
+}
+
puts $f " .section .debug_line"
out_compdir out_line
# - the name of the file where the generated assembly
# code is written.
# default = "".
+ # file_id <tcl channel identifier>
+ # - open file where the generated assemble core is written.
+ # default = "".
# add_dummy_cus <0|1>
# - Whether to add dummy CUs before and after the CUs
# added in the BODY.
parse_options {
{ filename "" }
+ { file_id "" }
{ add_dummy_cus 1 }
}
set _initialized 1
}
- set _output_file [open $filename w]
+ if { $file_id != "" } {
+ set _output_file $file_id
+ } else {
+ set _output_file [open $filename w]
+ }
+
set _cu_count -1
_empty_array _deferred_output
set _defer ""
_write_deferred_output
- catch {close $_output_file}
+ if { $file_id == "" } {
+ catch {close $_output_file}
+ }
set _output_file {}
}
}