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

Re: [rfc, arm] Always use correct execution state for single-step breakpoints


Joel Brobecker wrote:
> > > > +if ![runto_main] then {
> > > > +    gdb_suppress_tests
> > > > +}
> 
> We decided a long time ago that gdb_suppress_entire_file,
> gdb_suppress_tests et al should no longer be used...

OK, fine with me.

> > I don't really have a strong opinion on that, except that perror is
> > probably wrong (this is supposed to be uses to signal problems in
> > the test *framework* itself).  I'd say that if there is a reasonable
> > expectation that starting up the test may fail on some platforms,
> > a failure of runto_main ought to trigger something like UNTESTED
> > or UNSUPPORTED.  Otherwise it should trigger a FAIL.
> 
> What we document right now is:
> 
>     if ![runto_main] {
>         return -1
>     }
> 
> (http://sourceware.org/gdb/wiki/GDBTestcaseCookbook)

Ah, I wasn't even aware we had this :-/   Nice!

> We might have discussed it, but I'm not sure.  I see your point
> about posting an UNTESTED OR UNSUPPORTED, which I think
> prepare_for_testing does.  In fact, an old message (from
> most likely DanielJ, in 2006):
> 
> > I've been using untested followed by return.  Why wouldn't that be
> > ideal?
> 
> So, if that's agreeable to everyone, I will change the Cookbook
> to follow that.

UNTESTED looks good to me.


Appended below is the current version of the test case I'm using.
Any additional thoughts?

Bye,
Ulrich

--- /dev/null	2011-03-29 13:48:30.897232565 +0200
+++ gdb/testsuite/gdb.arch/thumb-singlestep.exp	2011-03-29 14:54:18.000000000 +0200
@@ -0,0 +1,38 @@
+# Copyright 2011 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test single-stepping into incorrectly marked Thumb routine
+
+if {![istarget arm*-*]} then {
+    verbose "Skipping ARM tests."
+    return
+}
+
+set testfile "thumb-singlestep"
+set srcfile ${testfile}.S
+
+set additional_flags "additional_flags=-mthumb"
+if [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} [list debug $additional_flags]] {
+    untested ${testfile}.exp
+    return -1
+}
+
+if ![runto_main] then {
+    untested ${testfile}.exp
+    return -1
+}
+
+gdb_test "si" "foo \\(\\) at .*${srcfile}.*mov r0,#42.*" "step into foo"
+


-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


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