X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Ftestsuite%2Flib%2Ffuture.exp;h=2ecff2ef20076727fef078b3a41858f7572b530b;hb=67218854b1987d89593ccaf5feaf5b29b1b976f2;hp=4f771b8cfc7bd2ed576b335102ebe66c032dab7c;hpb=c44af4ebc000f606d16b42224cba2cfe80391d5c;p=external%2Fbinutils.git diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp index 4f771b8..2ecff2e 100644 --- a/gdb/testsuite/lib/future.exp +++ b/gdb/testsuite/lib/future.exp @@ -105,6 +105,22 @@ proc gdb_find_go_linker {} { return [find_go] } +proc gdb_find_rustc {} { + global tool_root_dir + if {![is_remote host]} { + set rustc [lookfor_file $tool_root_dir rustc] + if {$rustc == ""} { + set rustc rustc + } + } else { + set rustc "" + } + if {$rustc != ""} { + append rustc " --color never" + } + return $rustc +} + proc gdb_find_ldd {} { global LDD_FOR_TARGET if [info exists LDD_FOR_TARGET] { @@ -262,6 +278,18 @@ proc gdb_default_target_compile {source destfile type options} { } } + if { $i == "rust" } { + set compiler_type "rust" + if {[board_info $dest exists rustflags]} { + append add_flags " [target_info rustflags]" + } + if {[board_info $dest exists rustflags]} { + set compiler [target_info rustflags] + } else { + set compiler [find_rustc] + } + } + if {[regexp "^dest=" $i]} { regsub "^dest=" $i "" tmp if {[board_info $tmp exists name]} { @@ -324,6 +352,7 @@ proc gdb_default_target_compile {source destfile type options} { global GNATMAKE_FOR_TARGET global GO_FOR_TARGET global GO_LD_FOR_TARGET + global RUSTC_FOR_TARGET if {[info exists GNATMAKE_FOR_TARGET]} { if { $compiler_type == "ada" } { @@ -370,6 +399,12 @@ proc gdb_default_target_compile {source destfile type options} { } } + if {[info exists RUSTC_FOR_TARGET]} { + if {$compiler_type == "rust"} { + set compiler $RUSTC_FOR_TARGET + } + } + if { $type == "executable" && $linker != "" } { set compiler $linker } @@ -388,7 +423,11 @@ proc gdb_default_target_compile {source destfile type options} { } if {$type == "object"} { - append add_flags " -c" + if {$compiler_type == "rust"} { + append add_flags "--emit obj" + } else { + append add_flags " -c" + } } if { $type == "preprocess" } { @@ -605,6 +644,11 @@ if {[info procs find_gdc] == ""} { set use_gdb_compile 1 } +if {[info procs find_rustc] == ""} { + rename gdb_find_rustc find_rustc + set use_gdb_compile 1 +} + if {$use_gdb_compile} { catch {rename default_target_compile {}} rename gdb_default_target_compile default_target_compile