+2020-07-22 Sandra Loosemore <sandra@codesourcery.com>
+
+ * lib/gdb.exp (gdb_wrapper_file, gdb_wrapper_flags):
+ Initialize to empty string at top level.
+ (gdb_wrapper_init): Revert check for file existence on build.
+ Build the wrapper in its default place, not a build-specific
+ location. When host == build, make the pathname absolute.
+ (gdb_compile): Delete leftover declaration of
+ gdb_wrapper_initialized. Check gdb_wrapper_file being an empty
+ string instead of uninitialized.
+
2020-07-22 Kevin Buettner <kevinb@redhat.com>
* gdb.base/corefile2.exp: New file.
set gdb_wrapper_initialized 0
set gdb_wrapper_target ""
+set gdb_wrapper_file ""
+set gdb_wrapper_flags ""
proc gdb_wrapper_init { args } {
global gdb_wrapper_initialized
global gdb_wrapper_flags
global gdb_wrapper_target
- # If the wrapper is initialized but the wrapper file cannot be
- # found anymore, the wrapper file must be built again.
- if { $gdb_wrapper_initialized == 1 && \
- [info exists gdb_wrapper_file] && \
- ![file exists $gdb_wrapper_file] } {
- verbose "reinitializing the wrapper"
- set gdb_wrapper_initialized 0
- }
-
if { $gdb_wrapper_initialized == 1 } { return; }
if {[target_info exists needs_status_wrapper] && \
[target_info needs_status_wrapper] != "0"} {
- set result [build_wrapper [standard_output_file "testglue.o"]]
+ set result [build_wrapper "testglue.o"]
if { $result != "" } {
set gdb_wrapper_file [lindex $result 0]
+ if ![is_remote host] {
+ set gdb_wrapper_file [file join [pwd] $gdb_wrapper_file]
+ }
set gdb_wrapper_flags [lindex $result 1]
} else {
warning "Status wrapper failed to build."
}
+ } else {
+ set gdb_wrapper_file ""
+ set gdb_wrapper_flags ""
}
+ verbose "set gdb_wrapper_file = $gdb_wrapper_file"
set gdb_wrapper_initialized 1
set gdb_wrapper_target [current_target_name]
}
global GDB_TESTCASE_OPTIONS
global gdb_wrapper_file
global gdb_wrapper_flags
- global gdb_wrapper_initialized
global srcdir
global objdir
global gdb_saved_set_unbuffered_mode_obj
if {[target_info exists needs_status_wrapper] && \
[target_info needs_status_wrapper] != "0" && \
- [info exists gdb_wrapper_file]} {
+ $gdb_wrapper_file != "" } {
lappend options "libs=${gdb_wrapper_file}"
lappend options "ldflags=${gdb_wrapper_flags}"
}