aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Cespedes <cespedes@debian.org>2002-03-03 18:58:40 +0100
committerJuan Cespedes <cespedes@debian.org>2002-03-03 18:58:40 +0100
commit8f8282f72eaeadc5419cd5470100e8dcaba5b7fd (patch)
tree793f74ac8f82eaacfe6fa36763a4d197d5147ec1
parent96c3fd0c58f7f57a0d8b317ba9b43dffc03a18a1 (diff)
downloadltrace-8f8282f72eaeadc5419cd5470100e8dcaba5b7fd.tar.gz
Version 0.3.23
* Fixed missing include <unistd.h> in trace.c * One arch-dependent function less (continue_after_breakpoint) * Fixed S/390 port (it didn't compile yet...)
-rw-r--r--debian/changelog8
-rw-r--r--sysdeps/linux-gnu/arm/regs.c5
-rw-r--r--sysdeps/linux-gnu/arm/trace.c12
-rw-r--r--sysdeps/linux-gnu/i386/regs.c5
-rw-r--r--sysdeps/linux-gnu/i386/trace.c12
-rw-r--r--sysdeps/linux-gnu/m68k/regs.c5
-rw-r--r--sysdeps/linux-gnu/m68k/trace.c12
-rw-r--r--sysdeps/linux-gnu/s390/regs.c5
-rw-r--r--sysdeps/linux-gnu/s390/trace.c19
-rw-r--r--sysdeps/linux-gnu/trace.c13
10 files changed, 45 insertions, 51 deletions
diff --git a/debian/changelog b/debian/changelog
index 9f3bf13..b178bac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+ltrace (0.3.23) unstable; urgency=low
+
+ * Fixed missing include <unistd.h> in trace.c
+ * One arch-dependent function less (continue_after_breakpoint)
+ * Fixed S/390 port (it didn't compile yet...)
+
+ -- Juan Cespedes <cespedes@debian.org> Sun, 3 Mar 2002 18:58:36 +0100
+
ltrace (0.3.22) unstable; urgency=low
* S/390: Removed extra target in sysdeps/linux-gnu/s390 which avoided
diff --git a/sysdeps/linux-gnu/arm/regs.c b/sysdeps/linux-gnu/arm/regs.c
index 97a3bfe..829bf18 100644
--- a/sysdeps/linux-gnu/arm/regs.c
+++ b/sysdeps/linux-gnu/arm/regs.c
@@ -23,6 +23,11 @@ get_instruction_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, off_pc, 0);
}
+void
+set_instruction_pointer(pid_t pid, long addr) {
+ ptrace(PTRACE_POKEUSER, pid, off_pc, addr);
+}
+
void *
get_stack_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, off_sp, 0);
diff --git a/sysdeps/linux-gnu/arm/trace.c b/sysdeps/linux-gnu/arm/trace.c
index 56a3c93..9201054 100644
--- a/sysdeps/linux-gnu/arm/trace.c
+++ b/sysdeps/linux-gnu/arm/trace.c
@@ -45,18 +45,6 @@ syscall_p(struct process * proc, int status, int * sysnum) {
return 0;
}
-void
-continue_after_breakpoint(struct process *proc, struct breakpoint * sbp) {
- if (sbp->enabled) disable_breakpoint(proc->pid, sbp);
- ptrace(PTRACE_POKEUSER, proc->pid, off_pc, sbp->addr);
- if (sbp->enabled == 0) {
- continue_process(proc->pid);
- } else {
- proc->breakpoint_being_enabled = sbp;
- ptrace(PTRACE_SINGLESTEP, proc->pid, 0, 0);
- }
-}
-
long
gimme_arg(enum tof type, struct process * proc, int arg_num) {
if (arg_num==-1) { /* return value */
diff --git a/sysdeps/linux-gnu/i386/regs.c b/sysdeps/linux-gnu/i386/regs.c
index e60634b..79522af 100644
--- a/sysdeps/linux-gnu/i386/regs.c
+++ b/sysdeps/linux-gnu/i386/regs.c
@@ -19,6 +19,11 @@ get_instruction_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, 4*EIP, 0);
}
+void
+set_instruction_pointer(pid_t pid, long addr) {
+ ptrace(PTRACE_POKEUSER, pid, 4*EIP, addr);
+}
+
void *
get_stack_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, 4*UESP, 0);
diff --git a/sysdeps/linux-gnu/i386/trace.c b/sysdeps/linux-gnu/i386/trace.c
index 5a258a3..b7ec6e3 100644
--- a/sysdeps/linux-gnu/i386/trace.c
+++ b/sysdeps/linux-gnu/i386/trace.c
@@ -37,18 +37,6 @@ syscall_p(struct process * proc, int status, int * sysnum) {
return 0;
}
-void
-continue_after_breakpoint(struct process *proc, struct breakpoint * sbp) {
- if (sbp->enabled) disable_breakpoint(proc->pid, sbp);
- ptrace(PTRACE_POKEUSER, proc->pid, 4*EIP, sbp->addr);
- if (sbp->enabled == 0) {
- continue_process(proc->pid);
- } else {
- proc->breakpoint_being_enabled = sbp;
- ptrace(PTRACE_SINGLESTEP, proc->pid, 0, 0);
- }
-}
-
long
gimme_arg(enum tof type, struct process * proc, int arg_num) {
if (arg_num==-1) { /* return value */
diff --git a/sysdeps/linux-gnu/m68k/regs.c b/sysdeps/linux-gnu/m68k/regs.c
index 1f51417..ff784bb 100644
--- a/sysdeps/linux-gnu/m68k/regs.c
+++ b/sysdeps/linux-gnu/m68k/regs.c
@@ -19,6 +19,11 @@ get_instruction_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, 4*PT_PC, 0);
}
+void
+set_instruction_pointer(pid_t pid, long addr) {
+ ptrace(PTRACE_POKEUSER, pid, 4*PT_PC, addr);
+}
+
void *
get_stack_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, 4*PT_USP, 0);
diff --git a/sysdeps/linux-gnu/m68k/trace.c b/sysdeps/linux-gnu/m68k/trace.c
index a39a6ee..6f0ee81 100644
--- a/sysdeps/linux-gnu/m68k/trace.c
+++ b/sysdeps/linux-gnu/m68k/trace.c
@@ -41,18 +41,6 @@ syscall_p(struct process * proc, int status, int * sysnum) {
return 0;
}
-void
-continue_after_breakpoint(struct process *proc, struct breakpoint * sbp) {
- if (sbp->enabled) disable_breakpoint(proc->pid, sbp);
- ptrace(PTRACE_POKEUSER, proc->pid, 4*PT_PC, sbp->addr);
- if (sbp->enabled == 0) {
- continue_process(proc->pid);
- } else {
- proc->breakpoint_being_enabled = sbp;
- ptrace(PTRACE_SINGLESTEP, proc->pid, 0, 0);
- }
-}
-
long
gimme_arg(enum tof type, struct process * proc, int arg_num) {
if (arg_num==-1) { /* return value */
diff --git a/sysdeps/linux-gnu/s390/regs.c b/sysdeps/linux-gnu/s390/regs.c
index 9246fc5..77bdb6d 100644
--- a/sysdeps/linux-gnu/s390/regs.c
+++ b/sysdeps/linux-gnu/s390/regs.c
@@ -24,6 +24,11 @@ get_instruction_pointer(pid_t pid) {
return (void *)(ptrace(PTRACE_PEEKUSER, pid, PT_PSWADDR, 0) & 0x7fffffff);
}
+void
+set_instruction_pointer(pid_t pid, long addr) {
+ ptrace(PTRACE_POKEUSER, pid, PT_PSWADDR, addr);
+}
+
void *
get_stack_pointer(pid_t pid) {
return (void *)ptrace(PTRACE_PEEKUSER, pid, PT_GPR15, 0);
diff --git a/sysdeps/linux-gnu/s390/trace.c b/sysdeps/linux-gnu/s390/trace.c
index 9b1e312..e15e89a 100644
--- a/sysdeps/linux-gnu/s390/trace.c
+++ b/sysdeps/linux-gnu/s390/trace.c
@@ -55,10 +55,11 @@ syscall_p(struct process * proc, int status, int * sysnum) {
}
if (svcop == 10 && *sysnum>=0) {
/* System call was encountered... */
- if (proc->current_syscall!=*sysnum) {
- return 1;
- } else {
+ if (proc->callstack_depth > 0 &&
+ proc->callstack[proc->callstack_depth-1].is_syscall) {
return 2;
+ } else {
+ return 1;
}
}
else {
@@ -70,18 +71,6 @@ syscall_p(struct process * proc, int status, int * sysnum) {
return 0;
}
-void
-continue_after_breakpoint(struct process *proc, struct breakpoint * sbp) {
- if (sbp->enabled) disable_breakpoint(proc->pid, sbp);
- ptrace(PTRACE_POKEUSER, proc->pid, PT_PSWADDR, sbp->addr);
- if (sbp->enabled == 0) {
- continue_process(proc->pid);
- } else {
- proc->breakpoint_being_enabled = sbp;
- ptrace(PTRACE_SINGLESTEP, proc->pid, 0, 0);
- }
-}
-
long
gimme_arg(enum tof type, struct process * proc, int arg_num) {
if (arg_num==-1) { /* return value */
diff --git a/sysdeps/linux-gnu/trace.c b/sysdeps/linux-gnu/trace.c
index 797fc13..a5728ed 100644
--- a/sysdeps/linux-gnu/trace.c
+++ b/sysdeps/linux-gnu/trace.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
+#include <unistd.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <asm/unistd.h>
@@ -72,6 +73,18 @@ continue_enabling_breakpoint(pid_t pid, struct breakpoint * sbp) {
continue_process(pid);
}
+void
+continue_after_breakpoint(struct process *proc, struct breakpoint * sbp) {
+ if (sbp->enabled) disable_breakpoint(proc->pid, sbp);
+ set_instruction_pointer(proc->pid, sbp->addr);
+ if (sbp->enabled == 0) {
+ continue_process(proc->pid);
+ } else {
+ proc->breakpoint_being_enabled = sbp;
+ ptrace(PTRACE_SINGLESTEP, proc->pid, 0, 0);
+ }
+}
+
int
umovestr(struct process * proc, void * addr, int len, void * laddr) {
long a;