projects
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* dsrec.c (load_srec, make_srec): Use bfd_get_section_size instead of
[binutils-gdb.git]
/
gdb
/
infptrace.c
diff --git
a/gdb/infptrace.c
b/gdb/infptrace.c
index 1225dd8a62c133441785edaee45207033a8e89c3..f40e6e97703905891437646dcfc3e6c7808c0a2e 100644
(file)
--- a/
gdb/infptrace.c
+++ b/
gdb/infptrace.c
@@
-76,13
+76,6
@@
#define PT_KILL 8 /* Send child a SIGKILL signal */
#endif
#define PT_KILL 8 /* Send child a SIGKILL signal */
#endif
-#ifndef PT_ATTACH
-#define PT_ATTACH PTRACE_ATTACH
-#endif
-#ifndef PT_DETACH
-#define PT_DETACH PTRACE_DETACH
-#endif
-
#include "gdbcore.h"
#ifndef NO_SYS_FILE
#include <sys/file.h>
#include "gdbcore.h"
#ifndef NO_SYS_FILE
#include <sys/file.h>
@@
-208,6
+201,7
@@
ptrace_wait (ptid_t ptid, int *status)
return wstate;
}
return wstate;
}
+#ifndef KILL_INFERIOR
void
kill_inferior (void)
{
void
kill_inferior (void)
{
@@
-229,6
+223,7
@@
kill_inferior (void)
ptrace_wait (null_ptid, &status);
target_mourn_inferior ();
}
ptrace_wait (null_ptid, &status);
target_mourn_inferior ();
}
+#endif /* KILL_INFERIOR */
#ifndef CHILD_RESUME
#ifndef CHILD_RESUME
@@
-277,18
+272,25
@@
child_resume (ptid_t ptid, int step, enum target_signal signal)
}
#endif /* CHILD_RESUME */
\f
}
#endif /* CHILD_RESUME */
\f
-
-#ifdef ATTACH_DETACH
/* Start debugging the process whose number is PID. */
int
attach (int pid)
{
errno = 0;
/* Start debugging the process whose number is PID. */
int
attach (int pid)
{
errno = 0;
+#ifndef PT_ATTACH
+#ifdef PTRACE_ATTACH
+#define PT_ATTACH PTRACE_ATTACH
+#endif
+#endif
+#ifdef PT_ATTACH
ptrace (PT_ATTACH, pid, (PTRACE_ARG3_TYPE) 0, 0);
if (errno)
perror_with_name ("ptrace");
attach_flag = 1;
return pid;
ptrace (PT_ATTACH, pid, (PTRACE_ARG3_TYPE) 0, 0);
if (errno)
perror_with_name ("ptrace");
attach_flag = 1;
return pid;
+#else
+ error ("This system does not support attaching to a process");
+#endif
}
/* Stop debugging the process whose number is PID
}
/* Stop debugging the process whose number is PID
@@
-299,13
+301,21
@@
void
detach (int signal)
{
errno = 0;
detach (int signal)
{
errno = 0;
+#ifndef PT_DETACH
+#ifdef PTRACE_DETACH
+#define PT_DETACH PTRACE_DETACH
+#endif
+#endif
+#ifdef PT_DETACH
ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1,
signal);
ptrace (PT_DETACH, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) 1,
signal);
- if (errno
&& errno != ESRCH
)
- p
error_with_name ("ptrace"
);
+ if (errno)
+ p
rint_sys_errmsg ("ptrace", errno
);
attach_flag = 0;
attach_flag = 0;
+#else
+ error ("This system does not support detaching from a process");
+#endif
}
}
-#endif /* ATTACH_DETACH */
\f
/* Default the type of the ptrace transfer to int. */
#ifndef PTRACE_XFER_TYPE
\f
/* Default the type of the ptrace transfer to int. */
#ifndef PTRACE_XFER_TYPE
@@
-357,14
+367,14
@@
fetch_register (int regno)
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
-
register
int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE];
int tid;
if (CANNOT_FETCH_REGISTER (regno))
{
unsigned int offset; /* Offset of registers within the u area. */
char buf[MAX_REGISTER_SIZE];
int tid;
if (CANNOT_FETCH_REGISTER (regno))
{
- memset (buf, '\0',
REGISTER_RAW_SIZE (regno));
/* Supply zeroes */
+ memset (buf, '\0',
DEPRECATED_REGISTER_RAW_SIZE (regno));
/* Supply zeroes */
supply_register (regno, buf);
return;
}
supply_register (regno, buf);
return;
}
@@
-376,7
+386,7
@@
fetch_register (int regno)
offset = U_REGS_OFFSET;
regaddr = register_addr (regno, offset);
offset = U_REGS_OFFSET;
regaddr = register_addr (regno, offset);
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ for (i = 0; i <
DEPRECATED_
REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
*(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid,
{
errno = 0;
*(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid,
@@
-421,7
+431,7
@@
store_register (int regno)
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
/* This isn't really an address. But ptrace thinks of it as one. */
CORE_ADDR regaddr;
char mess[128]; /* For messages */
-
register
int i;
+ int i;
unsigned int offset; /* Offset of registers within the u area. */
int tid;
char buf[MAX_REGISTER_SIZE];
unsigned int offset; /* Offset of registers within the u area. */
int tid;
char buf[MAX_REGISTER_SIZE];
@@
-443,7
+453,7
@@
store_register (int regno)
regcache_collect (regno, buf);
/* Store the local buffer into the inferior a chunk at the time. */
regcache_collect (regno, buf);
/* Store the local buffer into the inferior a chunk at the time. */
- for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ for (i = 0; i <
DEPRECATED_
REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
{
errno = 0;
ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
@@
-596,9
+606,6
@@
child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
if (errno)
return 0;
}
if (errno)
return 0;
}
-#ifdef CLEAR_INSN_CACHE
- CLEAR_INSN_CACHE ();
-#endif
}
else
{
}
else
{