This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix annota-input-while-running.exp remote check


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=740feeaa2049d0f9a7e5928191124583a1a8c645

commit 740feeaa2049d0f9a7e5928191124583a1a8c645
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Mon May 2 13:04:42 2016 -0400

    Fix annota-input-while-running.exp remote check
    
    The comment says that we can't use runto_main here becore it doesn't
    know how to handle annotation.  Instead, the test puts a breakpoint at
    main and calls run by hand.  Therefore, it can't work with stub targets,
    since they can't "run".  The check should be then changed to check the
    use_gdb_stub variable instead of [is_remote target].
    
    But as an alternative, we can just use runto_main and enable annotations
    after, since the "run to main" part is not really part of what we want
    to test.
    
    I also removed the "set test..." line that is unused.
    
    gdb/testsuite/ChangeLog:
    
    	* gdb.base/annota-input-while-running.exp: Don't check for
    	[is_remote target].  Enable annotations after running to main.
    	Remove unused "set test..." line.

Diff:
---
 gdb/testsuite/ChangeLog                            |  6 ++++++
 .../gdb.base/annota-input-while-running.exp        | 25 ++++++----------------
 2 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 710b2af..fb6538c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-02  Simon Marchi  <simon.marchi@ericsson.com>
+
+	* gdb.base/annota-input-while-running.exp: Don't check for
+	[is_remote target].  Enable annotations after running to main.
+	Remove unused "set test..." line.
+
 2016-04-28  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* gdb.trace/trace-enable-disable.exp: New file.
diff --git a/gdb/testsuite/gdb.base/annota-input-while-running.exp b/gdb/testsuite/gdb.base/annota-input-while-running.exp
index 9a0ca84..adc96e4 100644
--- a/gdb/testsuite/gdb.base/annota-input-while-running.exp
+++ b/gdb/testsuite/gdb.base/annota-input-while-running.exp
@@ -16,23 +16,18 @@
 # Test that annotations support doesn't leave GDB's terminal settings
 # into effect when we run a foreground command.
 
-if [is_remote target] then {
-    # We cannot use runto_main because of the different prompt we get
-    # when using annotation level 2.
-    return 0
-}
-
 standard_testfile
 
 if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug] == -1} {
     return -1
 }
 
-# Break at main
-
-gdb_test "break main" \
-    "Breakpoint.*at.* file .*$srcfile.*\\." \
-    "breakpoint main"
+# Because runto_main doesn't know how to handle the prompt with annotations,
+# run to main before we set the annotation level.
+if ![runto_main] then {
+-   fail "Can't run to main"
+-   return 1
+}
 
 # NOTE: this prompt is OK only when the annotation level is > 1
 # NOTE: When this prompt is in use the gdb_test procedure cannot be
@@ -59,16 +54,8 @@ proc gdb_annota_test {command pattern message} {
 }
 
 # Set the annotation level to 2.
-
-set test "annotation set at level 2"
 gdb_annota_test "set annotate 2" ".*" "annotation set at level 2"
 
-# Run to main.
-
-gdb_annota_test "run" \
-    "\r\n\032\032post-prompt.*\r\n\r\n\032\032stopped.*" \
-    "run until main breakpoint"
-
 set test "delete breakpoints"
 gdb_test_multiple "delete" $test {
     -re "Delete all breakpoints. .y or n." {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]