aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2015-10-26 22:07:27 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2015-10-26 22:07:27 -0400
commitd7f3ff3ea7830389f458be7c5eadb5d4a4e0a90b (patch)
tree32647c1b1bb469a6718581a4c9de2b9b38bf98af /gdb
parentbf6778dab2b3efc5a0ab01ee41e62e966ef08069 (diff)
downloadgdb-d7f3ff3ea7830389f458be7c5eadb5d4a4e0a90b.zip
gdb-d7f3ff3ea7830389f458be7c5eadb5d4a4e0a90b.tar.gz
gdb-d7f3ff3ea7830389f458be7c5eadb5d4a4e0a90b.tar.bz2
target.c: Add a cast and change a type
Fixes some errors in C++ build. gdb/ChangeLog: * target.c (memory_xfer_partial): Change type of buf to gdb_byte pointer. (simple_search_memory): Cast return of memmem.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/target.c8
2 files changed, 10 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 568d486..f15dda5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2015-10-26 Simon Marchi <simon.marchi@polymtl.ca>
+ * target.c (memory_xfer_partial): Change type of buf to gdb_byte
+ pointer.
+ (simple_search_memory): Cast return of memmem.
+
+2015-10-26 Simon Marchi <simon.marchi@polymtl.ca>
+
* stap-probe.c (handle_stap_probe): Add (const char *) casts.
2015-10-26 Simon Marchi <simon.marchi@polymtl.ca>
diff --git a/gdb/target.c b/gdb/target.c
index b8b1e9b..d7653c4 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1235,7 +1235,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
}
else
{
- void *buf;
+ gdb_byte *buf;
struct cleanup *old_chain;
/* A large write request is likely to be partially satisfied
@@ -1245,7 +1245,7 @@ memory_xfer_partial (struct target_ops *ops, enum target_object object,
subset of it. Cap writes to 4KB to mitigate this. */
len = min (4096, len);
- buf = xmalloc (len);
+ buf = (gdb_byte *) xmalloc (len);
old_chain = make_cleanup (xfree, buf);
memcpy (buf, writebuf, len);
@@ -2391,8 +2391,8 @@ simple_search_memory (struct target_ops *ops,
gdb_byte *found_ptr;
unsigned nr_search_bytes = min (search_space_len, search_buf_size);
- found_ptr = memmem (search_buf, nr_search_bytes,
- pattern, pattern_len);
+ found_ptr = (gdb_byte *) memmem (search_buf, nr_search_bytes,
+ pattern, pattern_len);
if (found_ptr != NULL)
{