From: Yao Qi <yao@codesourcery.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Mark Kettenis <mark.kettenis@xs4all.nl>
Subject: Re: [patch, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGILL
Date: Thu, 09 Jun 2011 13:25:00 -0000 [thread overview]
Message-ID: <4DF0C99C.30703@codesourcery.com> (raw)
In-Reply-To: <201106091241.19314.pedro@codesourcery.com>
On 06/09/2011 07:41 PM, Pedro Alves wrote:
> On Thursday 09 June 2011 12:17:27, Mark Kettenis wrote:
>>> Date: Thu, 09 Jun 2011 17:28:09 +0800
>>> From: Yao Qi <yao@codesourcery.com>
>>>
>>> In current gdb.base/savedregs.exp, signal handler is installed for
>>> signal SIGSEGV, and SIGSEGV is trigger by `*(char *)0 = 0;'. However,
>>> on non-mmu uclinux system, writing to an address 0x0 doesn't trigger
>>> SIGSEGV.
>>>
>>> In my patch, SIGILL is chosen to replace SIGSEGV. One assumption here
>>> is that 0xffff is an invalid instruction on all ports.
>>
>> Please don't do this. You're changing the test significantly. And
>> there is no guarantee that 0xffff is an invalid instruction. Heck
>> most platforms don't even have 16-bit instructions.
>
> If backtracing through 0 is important to this test (haven't looked),
> and replacing the write to 0 by raise(SIGSEGV) won't cut it,
> then you can use the same trick sigbpt.exp, signest.exp, signull.exp
> use to skip the test on targets without an MMU.
>
Pedro,
Thanks for this trick, which I don't know before. SIGSEGV usage in
savedregs.exp is a little bit different from them. In savedregs.exp,
SIGSEGV is used to trigger invocation of signal handler, and check
registers contents in signal trampoline frame. If my understand is
correct, I can't see any reason that we can't replace SIGSEGV by SIGILL,
or other signal.
Of course, we can skip savedregs.exp with the same trick, but it is
imperfect that we skip a test which can be run naturally.
--
Yao (é½å°§)
next prev parent reply other threads:[~2011-06-09 13:25 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 9:28 Yao Qi
2011-06-09 10:08 ` Andreas Schwab
2011-06-09 10:53 ` Yao Qi
2011-06-09 11:19 ` Mark Kettenis
2011-06-09 11:41 ` Pedro Alves
2011-06-09 13:25 ` Yao Qi [this message]
2011-06-09 13:10 ` Yao Qi
2011-06-09 14:25 ` Pedro Alves
2011-06-20 4:13 ` [patch V2, testsuite] gdb.base/savedregs.exp: SIGSEGV -> SIGALRM Yao Qi
2011-06-20 7:03 ` Mark Kettenis
2011-06-20 8:26 ` Yao Qi
2011-06-20 11:12 ` Mark Kettenis
2011-06-20 15:07 ` Yao Qi
2011-06-20 15:14 ` Paul Koning
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=4DF0C99C.30703@codesourcery.com \
--to=yao@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
--cc=pedro@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