[10/14] gdb/testsuite: Fix gdb.base/chng-syms.exp for remote target

Message ID 20200207150003.8383-11-shahab.vahedi@gmail.com
State New, archived
Headers

Commit Message

Shahab Vahedi Feb. 7, 2020, 2:59 p.m. UTC
  From: Anton Kolesov <Anton.Kolesov@synopsys.com>

The pattern with which proc "gdb_load" in config/monitor.exp catches
errors during application load is not always appropriate - it assumes
that any message with the word "failed" in it means a load failure,
which is not correct. For example, testcase gdb.base/chng-syms.exp
causes a message: "warning: failed to reevaluate condition for
breakpoint 1" which is an expected result and doesn't mean that load
itself failed.

gdb/testsuite/ChangeLog:
2016-07-19  Anton Kolesov <Anton.Kolesov@synopsys.com>

	* config/monitor.exp (gdb_load): Handle a false positive
	failure case.

Signed-off-by: Anton Kolesov <Anton.Kolesov@synopsys.com>
---
 gdb/testsuite/config/monitor.exp | 8 ++++++++
 1 file changed, 8 insertions(+)
  

Patch

diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp
index 7e74dad100cc..f215ee4ea4c8 100644
--- a/gdb/testsuite/config/monitor.exp
+++ b/gdb/testsuite/config/monitor.exp
@@ -230,6 +230,14 @@  proc gdb_load { arg } {
 	    set load_ok 0
 	    send_gdb $command
 	    gdb_expect $loadtimeout {
+		-re "warning: failed to reevaluate condition" {
+		    # Catching just any "failed" word is not correct here. For
+		    # example, testcase gdb.base/chng-syms.exp causes a message:
+		    # "warning: failed to reevaluate condition for breakpoint 1"
+		    # which is an expected result and doesn't mean that load
+		    # itself failed.
+		    exp_continue
+		}
 		-re "\[Ff\]ailed.*$gdb_prompt $" {
 		    verbose "load failed"
 		}