Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Matthew Gretton-Dann <matthew.gretton-dann@arm.com>
To: Yao Qi <yao@codesourcery.com>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
	 "pedro@codesourcery.com" <pedro@codesourcery.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] Skip kill-after-signal.exp if hw single-step is not supported
Date: Tue, 09 Aug 2011 15:24:00 -0000	[thread overview]
Message-ID: <4E415111.7020107@arm.com> (raw)
In-Reply-To: <4E414503.7080201@codesourcery.com>

On 09/08/11 15:32, Yao Qi wrote:
> On 07/24/2011 06:47 AM, Mark Kettenis wrote:
>>> From: Pedro Alves<pedro@codesourcery.com>
>>> Date: Wed, 20 Jul 2011 16:05:43 +0100
>>>
>>> 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.
>>
>> Just FYI, it's putting breakpoints into the signal trampoline that is
>> the issue, at least on OpenBSD.  Single-stepping should work fine on
>> OpenBSD/i386 and OpenBSD/amd64 and all other architectures where it's
>> done in hardware.
>
> This is the 2nd version of the patch.  A new predicate,
> single_step_to_signal_handler_p, is added in lib/gdb.exp.  In default,
> it returns true, and return false on target "arm*-*-* and "mips*-*-*".
>
> I don't find any other tests using "stepi" to step into signal handler,
> so I only changed kill-after-signal.exp.
>
> OK for mainline?
>
>
>
> single_step_to_signal_handler_p.patch
>
>
>
> gdb/testsuite/
>
> 	* lib/gdb.exp (single_step_to_signal_handler_p): New.
> 	* gdb.base/kill-after-signal.exp: Skip if target supports single step
> 	to signal handler.
>
> diff --git a/gdb/testsuite/gdb.base/kill-after-signal.exp b/gdb/testsuite/gdb.base/kill-after-signal.exp
> index eecad2e..f7086fc 100644
> --- a/gdb/testsuite/gdb.base/kill-after-signal.exp
> +++ b/gdb/testsuite/gdb.base/kill-after-signal.exp
> @@ -14,6 +14,12 @@
>   # along with this program.  If not, see<http://www.gnu.org/licenses/>.
>
>   set testfile "kill-after-signal"
> +
> +if { ![single_step_to_signal_handler_p] } {
> +    untested ${testfile}.exp
> +    return
> +}
> +
>   if [prepare_for_testing ${testfile}.exp ${testfile}] {
>       return -1
>   }
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index ef5ad5c..b967a97 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -1527,6 +1527,21 @@ proc support_complex_tests {} {
>       return $support_complex_tests_saved
>   }
>
> +# Return 1 if target hardware or OS supports single stepping to single handler,
> +# otherwise, return 0.
> +
> +proc single_step_to_signal_handler_p {} {
> +
> +    # Targets don't have hardware single step.  On these targets, when a signal
> +    # is delivered during software single step, gdb is unable to determine the
> +    # next instruction addresses, because start of signal handler is one of them.
> +    if { [istarget "arm*-*-*"] || [istarget "mips*-*-*"] } {
> +	return 0
> +    }
> +
> +    return 1
> +}
> +

Would this be better if it followed the pattern of the 
skip_hw_breakpoint_tests and skip_hw_watchpoint_tests family of 
functions in gdb.exp?

So I would rename the function to skip_hw_single_step_tests[1], and test 
for the existence of gdb,no_hardware_watchpoints in the board info.

[1] Although for the use you are putting it to this is possibly a 
confusing name.

Thanks,

Matt


-- 
Matthew Gretton-Dann
Principal Engineer, PD Software - Tools, ARM Ltd


  reply	other threads:[~2011-08-09 15:24 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-19 14:52 Yao Qi
2011-07-20 15:06 ` Jan Kratochvil
2011-07-20 15:12 ` Pedro Alves
2011-07-24 11:40   ` Mark Kettenis
2011-08-09 14:32     ` Yao Qi
2011-08-09 15:24       ` Matthew Gretton-Dann [this message]
2011-08-09 15:50         ` Yao Qi
2011-08-18  4:53       ` ping : " Yao Qi
2011-08-28 14:44         ` Yao Qi
2011-09-14  7:18       ` ping 3: " Yao Qi
2011-09-18  2:42       ` Joel Brobecker
2011-09-18 10:22         ` [committed]: " Yao Qi
2011-07-23 23:28 ` Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E415111.7020107@arm.com \
    --to=matthew.gretton-dann@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=pedro@codesourcery.com \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox