This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] solib-spu: Add gdb_byte* cast


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5af9928d44e302b7f68365a0c551f640895366ff

commit 5af9928d44e302b7f68365a0c551f640895366ff
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Thu Oct 22 09:46:31 2015 -0400

    solib-spu: Add gdb_byte* cast
    
    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.

Diff:
---
 gdb/ChangeLog   | 4 ++++
 gdb/solib-spu.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9c8ae4c..6fefc63 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2015-10-22  Simon Marchi  <simon.marchi@polymtl.ca>
 
+	* solib-spu.c (spu_bfd_iovec_pread): Add (gdb_byte *) cast.
+
+2015-10-22  Simon Marchi  <simon.marchi@polymtl.ca>
+
 	* rs6000-tdep.c (variants): Add (enum bfd_architecture) cast.
 
 2015-10-22  Simon Marchi  <simon.marchi@polymtl.ca>
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 468ab1a..dca13e0 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]