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] Problem with gdb_breakpoint change for pending breakpoints


This patch:

2004-02-02  Jeff Johnston  <jjohnstn@redhat.com>

        * lib/gdb.exp (gdb_breakpoint): Add pending breakpoint
        support.

made gdb_breakpoint look like this:

proc gdb_breakpoint { function } {
    global gdb_prompt
    global decimal

    send_gdb "break $function\n"
    # The first two regexps are what we get with -g, the third is without -g.
    gdb_expect 30 {
	-re "Breakpoint \[0-9\]* at .*: file .*, line $decimal.\r\n$gdb_prompt $" {}
	-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
	-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
	-re "Make breakpoint pending.*y or n. $" { 
		gdb_test "n" "" "setting breakpoint at $function" ;
		return 1;
	}
	-re "$gdb_prompt $" { fail "setting breakpoint at $function" ; return 0 }
	timeout { fail "setting breakpoint at $function (timeout)" ; return 0 }
    }
    return 1;
}    

Unfortunately this means that breakpoints on non-existent functions [which
my current broken working tree causes to happen a lot more for Java] are now
passes when they should be failures.  I've checked in this patch to fix the
problem.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

2004-02-08  Daniel Jacobowitz  <drow@mvista.com>

	* lib/gdb.exp (gdb_breakpoint): Fail on unexpected pending
	breakpoints.

Index: testsuite/lib/gdb.exp
===================================================================
RCS file: /big/fsf/rsync/src-cvs/src/gdb/testsuite/lib/gdb.exp,v
retrieving revision 1.46
diff -u -p -r1.46 gdb.exp
--- testsuite/lib/gdb.exp	8 Feb 2004 03:56:15 -0000	1.46
+++ testsuite/lib/gdb.exp	8 Feb 2004 22:18:31 -0000
@@ -276,8 +276,8 @@ proc gdb_breakpoint { function } {
 	-re "Breakpoint \[0-9\]*: file .*, line $decimal.\r\n$gdb_prompt $" {}
 	-re "Breakpoint \[0-9\]* at .*$gdb_prompt $" {}
 	-re "Make breakpoint pending.*y or n. $" { 
-		gdb_test "n" "" "setting breakpoint at $function" ;
-		return 1;
+		send_gdb "n\n"
+		exp_continue
 	}
 	-re "$gdb_prompt $" { fail "setting breakpoint at $function" ; return 0 }
 	timeout { fail "setting breakpoint at $function (timeout)" ; return 0 }


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