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]

Re: [RFA] [PATCH] gdb.base/break.exp


OK.  Here is version #3 of a break.exp patch.

This patch fixes these test failures on i686-pc-linux-gnu (native):

  FAIL: gdb.base/break.exp: break main #1
  FAIL: gdb.base/break.exp: break main #2
  FAIL: gdb.base/break.exp: clear main

In this version, I move the "break break clear" test before the "finish"
command.  I moved it right next to another existing test that calls
"break marker2".

Indeed, at the point the test is now, the program counter is in a scope
which we control where the program-under-test already calls "marker3"
as a function.  So "marker3" *must* be a function name there, or break.c
will get a glaring compilation error.

That ought to extinguish the concerns about __libc_start_main and its
local symbols that we don't control.  :)

"What does not kill my patch, makes it stronger".  :)

Michael Elizabeth Chastain
<chastain@redhat.com>
"love without fear"

---

2000-11-28  Michael Chastain  <chastain@redhat.com>

	* break.exp (test_clear_command): use a marker function
	rather than 'main' for the test function.  Also move this
	test to an execution point where the marker function names are
	guaranteed to be bound to functions.  (Executing tests after a
	'finish' from main runs into name conflicts with local names
	in __libc_start_main).

Index: gdb/testsuite/gdb.base/break.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.6
diff -c -3 -p -r1.6 break.exp
*** gdb/testsuite/gdb.base/break.exp	2000/11/17 16:24:48	1.6
--- gdb/testsuite/gdb.base/break.exp	2000/11/28 18:26:45
*************** gdb_expect {
*** 520,525 ****
--- 520,534 ----
    timeout {fail "(timeout) clear current line has no breakpoint disallowed"}
  }
  
+ # Verify that we can set and clear multiple breakpoints.
+ #
+ # We don't test that it deletes the correct breakpoints.  We do at
+ # least test that it deletes more than one breakpoint.
+ #
+ gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #1"
+ gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #2"
+ gdb_test "clear marker3" {Deleted breakpoints [0-9]+ [0-9]+.*}
+ 
  # Verify that a breakpoint can be set via a convenience variable.
  #
  send_gdb "set \$foo=81\n"
*************** if [istarget "hppa*-*-hpux*"] then {
*** 706,720 ****
  #********
  
  
- proc test_clear_command {} {
-     gdb_test "break main" "Breakpoint.*at.*" "break main #1"
-     gdb_test "break main" "Breakpoint.*at.*" "break main #2"
- 
-     # We don't test that it deletes the correct breakpoints.  We do at
-     # least test that it deletes more than one breakpoint.
-     gdb_test "clear main" {Deleted breakpoints [0-9]+ [0-9]+.*}
- }
- 
  #
  # Test "next" over recursive function call.
  #
--- 715,720 ----
*************** proc test_next_with_recursion {} { 
*** 802,808 ****
     gdb_stop_suppressing_tests;
  }
  
- test_clear_command
  test_next_with_recursion
  
  
--- 802,807 ----

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