diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2010-06-19 17:36:51 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2010-06-19 17:36:51 +0000 |
commit | d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0 (patch) | |
tree | 321615fd866fdd7f688d14fbf8b62ba1de12ff36 /gdb/testsuite/gdb.arch | |
parent | fbece226ba5bc19f942384f8a048eba3bd92f99a (diff) | |
download | gdb-d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0.zip gdb-d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0.tar.gz gdb-d2ed6730f2ef390d50a47ea03ee3a5b1dd5e37f0.tar.bz2 |
ChangeLog:
* spu-multiarch.c (spu_xfer_partial): Wrap around local store
limit on local store memory accesses.
* spu-linux-nat.c (spu_xfer_partial): Likewise.
* spu-tdep.c (spu_lslr): Remove.
(spu_pointer_to_address): Do not truncate addresses.
(spu_integer_to_address): Likewise.
(spu_overlay_new_objfile): Use SPU_OVERLAY_LMA.
* spu-tdep.h: Add comments.
(SPUADDR_SPU): Respect SPU_OVERLAY_LMA bit.
(SPU_OVERLAY_LMA): Define.
gdbserver/ChangeLog:
* spu-low.c (spu_read_memory): Wrap around local store limit.
(spu_write_memory): Likewise.
testsuite/ChangeLog:
* gdb.arch/spu-ls.exp: New file.
* gdb.arch/spu-ls.c: Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.arch')
-rw-r--r-- | gdb/testsuite/gdb.arch/spu-ls.c | 31 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/spu-ls.exp | 54 |
2 files changed, 85 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.arch/spu-ls.c b/gdb/testsuite/gdb.arch/spu-ls.c new file mode 100644 index 0000000..4cb651f --- /dev/null +++ b/gdb/testsuite/gdb.arch/spu-ls.c @@ -0,0 +1,31 @@ +/* Copyright 2010 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/>. + + This file is part of the gdb testsuite. + + Contributed by Ulrich Weigand <uweigand@de.ibm.com>. + Tests for SPU local-store access. */ + +char *ptr = (char *)0x12345678; + +char array[256]; + +int +main (unsigned long long speid, unsigned long long argp, + unsigned long long envp) +{ + return 0; +} + diff --git a/gdb/testsuite/gdb.arch/spu-ls.exp b/gdb/testsuite/gdb.arch/spu-ls.exp new file mode 100644 index 0000000..967d057 --- /dev/null +++ b/gdb/testsuite/gdb.arch/spu-ls.exp @@ -0,0 +1,54 @@ +# Copyright 2010 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/>. +# +# This file is part of the gdb testsuite. +# +# Contributed by Ulrich Weigand <uweigand@de.ibm.com>. +# Tests for SPU local-store access. + +if { ![istarget "spu-*-elf"] } then { + verbose "Skipping SPU-only testcase" + return +} + +set testfile "spu-ls" +set srcfile ${testfile}.c +set binfile ${objdir}/${subdir}/${testfile} +set sources ${srcdir}/${subdir}/${srcfile} + +if { [gdb_compile $sources ${binfile} executable { debug }] != "" } { + return -1 +} + +gdb_exit +gdb_start +gdb_reinitialize_dir $srcdir/$subdir +gdb_load ${binfile} + +if ![runto_main] then { + fail "Can't run to main" + return 0 +} + +gdb_test "print ptr" " = 0x12345678 \".*\"" "print ptr" +gdb_test_no_output "set ptr = array + \$lslr + 1" "set ptr = array + \$lslr + 1" +gdb_test_no_output "set array\[0\] = 1" "set array\[0\] = 1" +gdb_test "print *ptr" " = 1 '\\\\001'" "print *ptr" +gdb_test_no_output "set *ptr = 2" "set *ptr = 2" +gdb_test "print array\[0\]" " = 2 '\\\\002'" "print array\[0\]" + +gdb_exit + +return 0 |