From: Simon Marchi Date: Fri, 23 Oct 2015 23:48:48 +0000 (-0400) Subject: Add mmap casts in linux-btrace.c X-Git-Tag: users/hjl/linux/release/2.25.51.0.4~1^2~7^2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a55515eecb1c8edb875e30a411afc55f304e88d9;p=thirdparty%2Fbinutils-gdb.git Add mmap casts in linux-btrace.c gdb/ChangeLog: * linux-btrace.c (linux_enable_pt): Add cast to mmap return. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4f506e5676a..a06f5685b16 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2015-10-23 Simon Marchi + + * linux-btrace.c (linux_enable_pt): Add cast to mmap return. + 2015-10-23 Simon Marchi * observer.h (observer_${event}_notification_stub): Add cast. diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c index 3173146cd3e..1c3cb402245 100644 --- a/gdb/nat/linux-btrace.c +++ b/gdb/nat/linux-btrace.c @@ -820,8 +820,9 @@ linux_enable_pt (ptid_t ptid, const struct btrace_config_pt *conf) goto err; /* Allocate the configuration page. */ - header = mmap (NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, - pt->file, 0); + header = ((struct perf_event_mmap_page *) + mmap (NULL, PAGE_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, + pt->file, 0)); if (header == MAP_FAILED) goto err_file; @@ -862,8 +863,9 @@ linux_enable_pt (ptid_t ptid, const struct btrace_config_pt *conf) header->aux_size = data_size; length = size; - pt->pt.mem = mmap (NULL, length, PROT_READ, MAP_SHARED, pt->file, - header->aux_offset); + pt->pt.mem = ((const uint8_t *) + mmap (NULL, length, PROT_READ, MAP_SHARED, pt->file, + header->aux_offset)); if (pt->pt.mem != MAP_FAILED) break; }