From a55515eecb1c8edb875e30a411afc55f304e88d9 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 23 Oct 2015 19:48:48 -0400 Subject: [PATCH] Add mmap casts in linux-btrace.c gdb/ChangeLog: * linux-btrace.c (linux_enable_pt): Add cast to mmap return. --- gdb/ChangeLog | 4 ++++ gdb/nat/linux-btrace.c | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) 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; } -- 2.30.2