This is the mail archive of the gdb-patches@sources.redhat.com 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]

[patch/testsuite] pending.exp: fix gdb_test "...\n"


This patch fixes some obvious bugs in gdb.base/pending.exp
with lines like:

  gdb_test "foo\n" "..."

The extra \n can desynchronize the gdb session.
Here is a gdb.log excerpt showing the problem.

  (gdb) PASS: gdb.base/pending.exp: pending plus real breakpoint info
  break pendfunc2
  Function "pendfunc2" not defined.
  Make breakpoint pending on future shared library load? (y or n) n
  (gdb) PASS: gdb.base/pending.exp: Don't set pending breakpoint
  condition 1 k == 1
  (gdb) PASS: gdb.base/pending.exp: condition 1 k == 1
  
  (gdb) FAIL: gdb.base/pending.exp: pending plus condition

In this session, the test script issued "condition 1 k == 1",
got back the right response, and then sent the extra "\n",
causing the next test to lose sync.

I tested this on native i686-pc-linux-gnu, gcc 2.95.3 3.3.2 HEAD,
dwarf-2 and stabs+.

I am committing this now, as an obvious fix.

(And I feel bad that I don't have time to review the new tests before
they get committed).

Michael C

2004-02-09  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.base/pending.exp: Remove extra \n from gdb_test calls.

Index: pending.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/pending.exp,v
retrieving revision 1.1
diff -c -3 -p -r1.1 pending.exp
*** pending.exp	2 Feb 2004 21:14:33 -0000	1.1
--- pending.exp	9 Feb 2004 10:46:08 -0000
*************** gdb_test_multiple "break pendfunc2" "Don
*** 151,157 ****
  # Add condition to pending breakpoint 
  #
  
! gdb_test "condition 1 k == 1\n" ""
  
  gdb_test "info break" \
      "Num Type\[ \]+Disp Enb Address\[ \]+What.*
--- 151,157 ----
  # Add condition to pending breakpoint 
  #
  
! gdb_test "condition 1 k == 1" ""
  
  gdb_test "info break" \
      "Num Type\[ \]+Disp Enb Address\[ \]+What.*
*************** gdb_test "info break" \
*** 164,170 ****
  # Disable pending breakpoint
  #
  
! gdb_test "disable 1\n" ""
  
  gdb_test "info break" \
      "Num Type\[ \]+Disp Enb Address\[ \]+What.*
--- 164,170 ----
  # Disable pending breakpoint
  #
  
! gdb_test "disable 1" ""
  
  gdb_test "info break" \
      "Num Type\[ \]+Disp Enb Address\[ \]+What.*


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