Lines 1-36
Link Here
|
1 |
commit 308f60064fee6d5707514b65f6acad656a8a4feb |
|
|
2 |
Author: Raphael Kubo da Costa <rakuco@FreeBSD.org> |
3 |
Date: Tue Feb 2 19:04:11 2016 +0100 |
4 |
|
5 |
FreeBSD: Do not try to cast NULL to int. |
6 |
|
7 |
Passing NULL to the data parameter in calls to ptrace(2) causes failures |
8 |
on 64-bit FreeBSD 9 installations, where GCC 4.2.1 complains like this: |
9 |
|
10 |
platform/freebsd/arch/x86_common.h: In function 'arch_get_register': |
11 |
platform/freebsd/arch/x86_common.h:48: warning: cast from pointer to integer of different size |
12 |
platform/freebsd/arch/x86_common.h: In function 'arch_set_register': |
13 |
platform/freebsd/arch/x86_common.h:57: warning: cast from pointer to integer of different size |
14 |
platform/freebsd/arch/x86_common.h:59: warning: cast from pointer to integer of different size |
15 |
platform/freebsd/freebsd_ptrace.c: In function 'ptrace_memcpy_to_child': |
16 |
platform/freebsd/freebsd_ptrace.c:267: warning: cast from pointer to integer of different size |
17 |
platform/freebsd/freebsd_ptrace.c: In function 'ptrace_memcpy_from_child': |
18 |
platform/freebsd/freebsd_ptrace.c:282: warning: cast from pointer to integer of different size |
19 |
|
20 |
Make ptrace_command pass 0 to _ptrace_command so that the final |
21 |
expansion looks like this: |
22 |
__ptrace_command((cld), (req), (void*)(addr), (int)(0)) |
23 |
instead of |
24 |
__ptrace_command((cld), (req), (void*)(addr), (int)(((void*)0))) |
25 |
|
26 |
--- platform/freebsd/freebsd_ptrace.c |
27 |
+++ platform/freebsd/freebsd_ptrace.c |
28 |
@@ -47,7 +47,7 @@ |
29 |
static int __ptrace_command(struct ptrace_child *child, int req, |
30 |
void *, int); |
31 |
|
32 |
-#define ptrace_command(cld, req, ...) _ptrace_command(cld, req, ## __VA_ARGS__, NULL, NULL) |
33 |
+#define ptrace_command(cld, req, ...) _ptrace_command(cld, req, ## __VA_ARGS__, 0, 0) |
34 |
#define _ptrace_command(cld, req, addr, data, ...) __ptrace_command((cld), (req), (void*)(addr), (int)(data)) |
35 |
|
36 |
|