This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: RFA: breakpoint.c and infrun.c changes
- To: Stan Shebs <shebs at cygnus dot com>
- Subject: Re: RFA: breakpoint.c and infrun.c changes
- From: Kevin Buettner <kevinb at cygnus dot com>
- Date: Fri, 24 Sep 1999 17:31:48 -0700
- Cc: gdb-patches at sourceware dot cygnus dot com, jimb at cygnus dot com, msnyder at cygnus dot com
- References: <199909241841.LAA03933@andros.cygnus.com>
On Sep 24, 11:41am, Stan Shebs wrote:
> Hmmm, when I ran tests on Alpha Linux a couple months ago I was
> getting pretty consistent results. Perhaps you could save a couple of
> the varying logs and point me at them?
I still have to do this...
> In any case, the results sound good, and the patch has been tested
> with a wider variety of targets than most patches get, so there's no
> reason not to check in now. If you get it in today, then it can be in
> Monday's snap for everybody to try out for themselves.
It's checked in.
Below is a testsuite patch for you to comment on. It actually adds two
tests. The first is to see if "break +1" works. The second is to
attempt to step onto a breakpoint. The second test failed on linux
prior to my infrun.c and breakpoint.c fixes. It passes now.
I tried to avoid modifying break.c, but found it necessary to
add one line. As a consequence, there were a number of small
adjustments that needed to be made to break.exp.
Kevin
Index: testsuite/gdb.base/break.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/break.c,v
retrieving revision 1.6
diff -u -r1.6 break.c
--- break.c 1999/09/08 18:18:56 1.6
+++ break.c 1999/09/25 00:17:01
@@ -82,7 +82,8 @@
marker2 (43);
marker3 ("stack", "trace");
marker4 (177601976L);
- return 0;
+ argc = (argc == 12345); /* This is silly, but we can step off of it */
+ return argc;
}
#ifdef PROTOTYPES
Index: testsuite/gdb.base/break.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/break.exp,v
retrieving revision 1.47
diff -u -r1.47 break.exp
--- break.exp 1999/09/18 15:43:20 1.47
+++ break.exp 1999/09/25 00:17:02
@@ -128,7 +128,7 @@
gdb_test "info break" \
"Num Type\[ \]+Disp Enb Address\[ \]+What.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
-\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:95.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:96.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:79.*
\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:85" \
@@ -180,17 +180,33 @@
# Run until the breakpoint set in a function in a file
#
for {set i 6} {$i >= 1} {incr i -1} {
- gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:95.*95\[\t \]+.*if .value > 1. \{.*" \
+ gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:96.*96\[\t \]+.*if .value > 1. \{.*" \
"run until file:function($i) breakpoint"
}
#
# run until the file:function breakpoint at a line number in a file
#
-gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:85.*85\[\t \]+return 0;" \
+gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:85.*85\[\t \]+argc = \\(argc == 12345\\);.*" \
"run until file:linenum breakpoint"
#
+# Test break at offset +1
+#
+
+gdb_test "break +1" \
+ "Breakpoint.*at.* file .*$srcfile, line 86\\." \
+ "breakpoint offset +1"
+
+#
+# Check to see if breakpoint is hit when stepped onto
+#
+
+gdb_test "step" \
+ ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:86.*86\[\t \]+return argc;" \
+ "step onto breakpoint"
+
+#
# delete all breakpoints so we can start over, course this can be a test too
#
delete_breakpoints
@@ -237,7 +253,7 @@
#
gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\]
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\]
-\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial$proto at .*$srcfile:95.*\[\r\n\]
+\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial$proto at .*$srcfile:96.*\[\r\n\]
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:79.*\[\r\n\]
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:75.*\[\r\n\]
\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:85.*\[\r\n\]
--
Kevin Buettner
kev@primenet.com, kevinb@cygnus.com