[c++,2/6] solib-spu: Add gdb_byte* cast
Commit Message
Fixes this error:
/home/simark/src/binutils-gdb/gdb/solib-spu.c: In function ‘file_ptr spu_bfd_iovec_pread(bfd*, void*, void*, file_ptr, file_ptr)’:
/home/simark/src/binutils-gdb/gdb/solib-spu.c:299:55: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive]
ret = target_read_memory (addr + offset, buf, nbytes);
^
In file included from /home/simark/src/binutils-gdb/gdb/target.h:65:0,
from /home/simark/src/binutils-gdb/gdb/exec.h:23,
from /home/simark/src/binutils-gdb/gdb/gdbcore.h:29,
from /home/simark/src/binutils-gdb/gdb/solib-spu.c:23:
/home/simark/src/binutils-gdb/gdb/target/target.h:35:12: note: initializing argument 2 of ‘int target_read_memory(CORE_ADDR, gdb_byte*, ssize_t)’
extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
gdb/ChangeLog:
* solib-spu.c (spu_bfd_iovec_pread): Add (gdb_byte *) cast.
---
gdb/solib-spu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 10/12/2015 05:32 AM, Simon Marchi wrote:
> Fixes this error:
>
> /home/simark/src/binutils-gdb/gdb/solib-spu.c: In function ‘file_ptr spu_bfd_iovec_pread(bfd*, void*, void*, file_ptr, file_ptr)’:
> /home/simark/src/binutils-gdb/gdb/solib-spu.c:299:55: error: invalid conversion from ‘void*’ to ‘gdb_byte* {aka unsigned char*}’ [-fpermissive]
> ret = target_read_memory (addr + offset, buf, nbytes);
> ^
> In file included from /home/simark/src/binutils-gdb/gdb/target.h:65:0,
> from /home/simark/src/binutils-gdb/gdb/exec.h:23,
> from /home/simark/src/binutils-gdb/gdb/gdbcore.h:29,
> from /home/simark/src/binutils-gdb/gdb/solib-spu.c:23:
> /home/simark/src/binutils-gdb/gdb/target/target.h:35:12: note: initializing argument 2 of ‘int target_read_memory(CORE_ADDR, gdb_byte*, ssize_t)’
> extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr,
>
> gdb/ChangeLog:
>
> * solib-spu.c (spu_bfd_iovec_pread): Add (gdb_byte *) cast.
OK.
Thanks,
Pedro Alves
@@ -296,7 +296,7 @@ spu_bfd_iovec_pread (bfd *abfd, void *stream, void *buf,
CORE_ADDR addr = *(CORE_ADDR *)stream;
int ret;
- ret = target_read_memory (addr + offset, buf, nbytes);
+ ret = target_read_memory (addr + offset, (gdb_byte *) buf, nbytes);
if (ret != 0)
{
bfd_set_error (bfd_error_invalid_operation);