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: [patch] Skip kill-after-signal.exp if hw single-step is not supported


On Tuesday 19 July 2011 15:43:33, Yao Qi wrote:
> This test `gdb_test "stepi" "\r\nhandler .*"' in kill-after-signal.exp
> performs a single-step, and deliver a signal (SIGUSR1) to inferior.
> Software single step can not do that, because the next instruction
> (start of handler) is unable to be determined.
> 
> This patch is to allow running this case only on x86 and x86_64, on
> which hardware single step is supported.
> 
> OK?
> 
> -- 
> Yao (éå)
> skip_kill_after_signal.patch
>   2011-07-19  Yao Qi  <yao@codesourcery.com>
> 
>         gdb/testsuite/
>         * gdb.base/kill-after-signal.exp: Skip if target doesn't support hardware
>         single step.
> 
> diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp
> index eecad2e..df0afe7 100644
> --- a/gdb/testsuite/gdb.base/kill-after-signal.exp
> +++ b/gdb/testsuite/gdb.base/kill-after-signal.exp
> @@ -14,6 +14,17 @@
>  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
>  
>  set testfile "kill-after-signal"
> +
> +if { ! [istarget "i?86-*-linux*"]
> +     && ! [istarget "x86_64-*-linux*"] } {

Other archs !x86, and other kernels/stubs/servers !Linux that
can do hardware stepping.  If we're going to have a list, invert
the logic of the check, defaulting to running the test, and leaving
out archs were we know software stepping is used.  Some targets,
like x86/OpenBSD and MacOS, although can hardware step, can't step
into a handler.  I think there are a couple more tests that rely on
stepping into a handler.  Maybe a predicate in gdb.exp for that
would be good.

> +    # skip it if target doesn't support hardware single-step.  In following tests,
> +    # in "stepi", a signal is delivered along with single-step.  In software single
> +    # step, gdb is unable to determine the next instruction addresses, because start
> +    # of signal handler is one of them.
> +    untested ${testfile}.exp
> +    return
> +}
> +
>  if [prepare_for_testing ${testfile}.exp ${testfile}] {
>      return -1
>  }

-- 
Pedro Alves


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