[c++,6/6] Add a cast in jit_target_read_impl

Message ID 1446123767-25046-7-git-send-email-simon.marchi@polymtl.ca
State Committed
Headers

Commit Message

Simon Marchi Oct. 29, 2015, 1:02 p.m. UTC
  We could change the signature of the function.  However, it would
require changing gdb_target_read in jit-reader.h, which is an exported
interface.  It's probably better to just add a cast in our code than to
break other people's code.

gdb/ChangeLog:

	* jit.c (jit_target_read_impl): Add cast.
---
 gdb/jit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Pedro Alves Oct. 29, 2015, 5:15 p.m. UTC | #1
On 10/29/2015 01:02 PM, Simon Marchi wrote:
> We could change the signature of the function.  However, it would
> require changing gdb_target_read in jit-reader.h, which is an exported
> interface.  It's probably better to just add a cast in our code than to
> break other people's code.

Agreed.

> 
> gdb/ChangeLog:
> 
> 	* jit.c (jit_target_read_impl): Add cast.

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/jit.c b/gdb/jit.c
index ddc223d..7c6aede 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -491,7 +491,8 @@  typedef CORE_ADDR jit_dbg_reader_data;
 static enum gdb_status
 jit_target_read_impl (GDB_CORE_ADDR target_mem, void *gdb_buf, int len)
 {
-  int result = target_read_memory ((CORE_ADDR) target_mem, gdb_buf, len);
+  int result = target_read_memory ((CORE_ADDR) target_mem,
+				   (gdb_byte *) gdb_buf, len);
   if (result == 0)
     return GDB_SUCCESS;
   else