1 /* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2003, 2004
2 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, write to the Free
17 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 #include <sys/types.h>
23 #include <sys/ptrace.h>
28 #include <sys/syscall.h>
29 #include <bp-checks.h>
32 #if _MIPS_SIM == _ABIN32
33 __extension__
typedef long long int reg_type
;
35 typedef long int reg_type
;
39 ptrace (enum __ptrace_request request
, ...)
47 va_start (ap
, request
);
48 pid
= va_arg (ap
, pid_t
);
49 addr
= va_arg (ap
, void *);
50 data
= va_arg (ap
, reg_type
);
53 if (request
> 0 && request
< 4)
56 #if __BOUNDED_POINTERS__
65 (void) CHECK_1 ((int *) addr
);
66 (void) CHECK_1 ((int *) data
);
71 /* We don't know the size of data, so the best we can do is ensure
72 that `data' is valid for at least one word. */
73 (void) CHECK_1 ((int *) data
);
76 case PTRACE_GETFPREGS
:
77 case PTRACE_SETFPREGS
:
78 /* We don't know the size of data, so the best we can do is ensure
79 that `data' is valid for at least one word. */
80 (void) CHECK_1 ((int *) data
);
83 case PTRACE_GETFPXREGS
:
84 case PTRACE_SETFPXREGS
:
85 /* We don't know the size of data, so the best we can do is ensure
86 that `data' is valid for at least one word. */
87 (void) CHECK_1 ((int *) data
);
93 case PTRACE_SINGLESTEP
:
97 /* Neither `data' nor `addr' needs any checks. */
102 res
= INLINE_SYSCALL (ptrace
, 4, request
, pid
,
103 __ptrvalue (addr
), __ptrvalue (data
));
104 if (res
>= 0 && request
> 0 && request
< 4)