]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use '.rs' extension for Rust in gdb_simple_compile
authorTom Tromey <tromey@adacore.com>
Tue, 5 Aug 2025 18:10:34 +0000 (12:10 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 5 Aug 2025 18:10:34 +0000 (12:10 -0600)
While trying out gccrs, I noticed that gdb_simple_compile does not use
the ".rs" extension for Rust sources.  This patch fixes the problem,
which lets gccrs get a little further in the test suite.

gdb/testsuite/lib/gdb.exp

index 0a582aac3548fc36e351c440e3dae600cde52512..98691dfce255e7bd50e024278866fea2913ae842 100644 (file)
@@ -5729,6 +5729,10 @@ proc gdb_simple_compile {name code {type object} {compile_flags {}} {object obj}
            set ext "d"
            break
        }
+       if { "$flag" eq "rust" } {
+           set ext "rs"
+           break
+       }
     }
     set src [standard_temp_file $name.$ext]
     set obj [standard_temp_file $name.$postfix]