[gdb/testsuite] Handle early_flags in gdb_default_target_compile
authorTom de Vries <tdevries@suse.de>
Tue, 30 Jun 2020 07:23:09 +0000 (09:23 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 30 Jun 2020 07:23:09 +0000 (09:23 +0200)
In gdb_default_target_compile, we use dejagnu's default_target_compile, unless
we need support for languages that are not yet support in the used dejagnu
version, in which case we use a local default_target_compile:
gdb_default_target_compile_1.

However, there's another reason to use the local default_target_compile: when
early_flags is used, because there's no dejagnu release available yet
supporting this.

Fix this by detecting and handling early_flags in gdb_default_target_compile.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-06-30  Tom de Vries  <tdevries@suse.de>

PR testsuite/26175
* lib/future.exp (gdb_default_target_compile): Detect and handle
early_flags.

gdb/testsuite/ChangeLog
gdb/testsuite/lib/future.exp

index b1bc547507dddb77f62223bf618b25bbe4b42668..cb984536cbeb1e3a89ad32bca29bef974ec927a2 100644 (file)
@@ -1,3 +1,9 @@
+2020-06-30  Tom de Vries  <tdevries@suse.de>
+
+       PR testsuite/26175
+       * lib/future.exp (gdb_default_target_compile): Detect and handle
+       early_flags.
+
 2020-06-29  Simon Marchi  <simon.marchi@efficios.com>
 
        * boards/simavr.exp (gdb_load): Catch errors when closing
index ba00a31c1971346acfce8548b4be51ad3b49800f..e10359317bde879552fb327a62a831fc652e8fbf 100644 (file)
@@ -634,25 +634,28 @@ proc gdb_default_target_compile_1 {source destfile type options} {
 proc gdb_default_target_compile {source destfile type options} {
     global use_gdb_compile
 
-    set need_local 0
+    set need_local_lang 0
+    set need_local_early_flags 0
     foreach i $options {
 
        if { $i == "ada" || $i == "d" || $i == "go" || $i == "rust" } {
-           set need_local [info exists use_gdb_compile($i)]
-           break
+           set need_local_lang [info exists use_gdb_compile($i)]
        }
 
        if { $i == "c++" } {
-           break
+           set need_local_lang 0
        }
 
        if { $i == "f77" || $i == "f90" } {
-           set need_local [info exists use_gdb_compile(fortran)]
-           break
+           set need_local_lang [info exists use_gdb_compile(fortran)]
+       }
+
+       if { [regexp "^early_flags=" $i] } {
+           set need_local_early_flags 1
        }
     }
 
-    if { $need_local } {
+    if { $need_local_lang || $need_local_early_flags } {
        return [gdb_default_target_compile_1 $source $destfile $type $options]
     }
 
This page took 0.032107 seconds and 4 git commands to generate.