This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Skip test 'watch -location nullptr->p->x' if null pointer can be dereferenced
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <yao at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Fri, 30 May 2014 13:12:40 +0100
- Subject: Re: [PATCH] Skip test 'watch -location nullptr->p->x' if null pointer can be dereferenced
- Authentication-results: sourceware.org; auth=none
- References: <1401254631-11264-1-git-send-email-yao at codesourcery dot com>
On 05/28/2014 06:23 AM, Yao Qi wrote:
> gdb.base/watchpoint.exp has a test below which expects to see "Cannot
> access memory at address 0x0" when a null pointer is dereferenced.
>
> gdb_test "watch -location nullptr->p->x" \
> "Cannot access memory at address 0x0"
>
> This assumption is not true when the target is no-mmu, so we get
>
> watch -location nullptr->p->x
> Hardware watchpoint 28: -location nullptr->p->x
> (gdb) FAIL: gdb.base/watchpoint.exp: watch -location nullptr->p->x
>
> This patch is to check whether null pointer can be dereferenced first
> and the then do the test.
s/the then/then/
> gdb/testsuite:
>
> 2014-05-28 Yao Qi <yao@codesourcery.com>
>
> * gdb.base/watchpoint.exp (test_watch_location): Check null
> pointer can be dereferenced. If not, do the test, otherwise
> skip it.
OK.
Thanks,
--
Pedro Alves