aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/linux-gnu/m68k
diff options
context:
space:
mode:
authorJuan Cespedes <cespedes@debian.org>2002-03-01 19:54:23 +0100
committerJuan Cespedes <cespedes@debian.org>2002-03-01 19:54:23 +0100
commit8cc1b9d456c8f41e3a8cc0d3ec0d77eb779cb7bb (patch)
treead52599fd70a115bbe3837fc0aca4fb2ba4ba3e2 /sysdeps/linux-gnu/m68k
parent5916fda0d07da90cac8a78cbfa73374d81b150be (diff)
downloadltrace-8cc1b9d456c8f41e3a8cc0d3ec0d77eb779cb7bb.tar.gz
Version: 0.3.18
* Simplified arch-dependent stuff * Updated list of syscalls and signals to Linux 2.4.18 * Unified coding-style of all function declarations * Do not indent lines indicating signals, exit codes, etc * Updated description * fix off-by-one problem in checking syscall number (Tim Waugh <twaugh@redhat.com> fixed this problem in RedHat two years ago; thank you for NOT noticing me...)
Diffstat (limited to 'sysdeps/linux-gnu/m68k')
-rw-r--r--sysdeps/linux-gnu/m68k/breakpoint.c8
-rw-r--r--sysdeps/linux-gnu/m68k/regs.c13
-rw-r--r--sysdeps/linux-gnu/m68k/trace.c22
3 files changed, 10 insertions, 33 deletions
diff --git a/sysdeps/linux-gnu/m68k/breakpoint.c b/sysdeps/linux-gnu/m68k/breakpoint.c
index 46c84ce..c74c4d2 100644
--- a/sysdeps/linux-gnu/m68k/breakpoint.c
+++ b/sysdeps/linux-gnu/m68k/breakpoint.c
@@ -5,8 +5,8 @@
#include <sys/ptrace.h>
#include "ltrace.h"
-void enable_breakpoint(pid_t pid, struct breakpoint * sbp)
-{
+void
+enable_breakpoint(pid_t pid, struct breakpoint * sbp) {
int a;
a = ptrace(PTRACE_PEEKTEXT, pid, sbp->addr, 0);
@@ -17,8 +17,8 @@ void enable_breakpoint(pid_t pid, struct breakpoint * sbp)
ptrace(PTRACE_POKETEXT, pid, sbp->addr, a);
}
-void disable_breakpoint(pid_t pid, const struct breakpoint * sbp)
-{
+void
+disable_breakpoint(pid_t pid, const struct breakpoint * sbp) {
int a;
a = ptrace(PTRACE_PEEKTEXT, pid, sbp->addr, 0);
diff --git a/sysdeps/linux-gnu/m68k/regs.c b/sysdeps/linux-gnu/m68k/regs.c
index f046f19..1f51417 100644
--- a/sysdeps/linux-gnu/m68k/regs.c
+++ b/sysdeps/linux-gnu/m68k/regs.c
@@ -14,18 +14,17 @@
# define PTRACE_POKEUSER PTRACE_POKEUSR
#endif
-void * get_instruction_pointer(pid_t pid)
-{
+void *
+get_instruction_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, 4*PT_PC, 0);
}
-void * get_stack_pointer(pid_t pid)
-{
+void *
+get_stack_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, 4*PT_USP, 0);
}
-void * get_return_addr(pid_t pid, void * stack_pointer)
-{
+void *
+get_return_addr(pid_t pid, void * stack_pointer) {
return (void *)ptrace(PTRACE_PEEKTEXT, pid, stack_pointer, 0);
}
-
diff --git a/sysdeps/linux-gnu/m68k/trace.c b/sysdeps/linux-gnu/m68k/trace.c
index 8d8af67..43586de 100644
--- a/sysdeps/linux-gnu/m68k/trace.c
+++ b/sysdeps/linux-gnu/m68k/trace.c
@@ -84,25 +84,3 @@ long gimme_arg(enum tof type, struct process * proc, int arg_num)
return 0;
}
-
-int umovestr(struct process * proc, void * addr, int len, void * laddr)
-{
- long a;
- int i;
- int offset=0;
-
- while(offset<len) {
- a = ptrace(PTRACE_PEEKTEXT, proc->pid, addr+offset, 0);
- for(i=0; i<sizeof(long); i++) {
- if (((char*)&a)[i] && offset+i < len) {
- *(char *)(laddr+offset+i) = ((char*)&a)[i];
- } else {
- *(char *)(laddr+offset+i) = '\0';
- return 0;
- }
- }
- offset += sizeof(long);
- }
- *(char *)(laddr+offset) = '\0';
- return 0;
-}