Pass Process * instead of pid to a couple functions
diff --git a/sysdeps/linux-gnu/breakpoint.c b/sysdeps/linux-gnu/breakpoint.c
index 576a26d..a9c9ac8 100644
--- a/sysdeps/linux-gnu/breakpoint.c
+++ b/sysdeps/linux-gnu/breakpoint.c
@@ -6,23 +6,14 @@
#include "common.h"
#include "arch.h"
-#ifdef ARCH_HAVE_ENABLE_BREAKPOINT
-extern void arch_enable_breakpoint(pid_t, Breakpoint *);
-void
-enable_breakpoint(pid_t pid, Breakpoint *sbp) {
- if (sbp->libsym) {
- debug(DEBUG_PROCESS, "enable_breakpoint: pid=%d, addr=%p, symbol=%s", pid, sbp->addr, sbp->libsym->name);
- } else {
- debug(DEBUG_PROCESS, "enable_breakpoint: pid=%d, addr=%p", pid, sbp->addr);
- }
- arch_enable_breakpoint(pid, sbp);
-}
-#else
-
static unsigned char break_insn[] = BREAKPOINT_VALUE;
+#ifdef ARCH_HAVE_ENABLE_BREAKPOINT
+extern void arch_enable_breakpoint(pid_t, Breakpoint *);
+#else /* ARCH_HAVE_ENABLE_BREAKPOINT */
void
-enable_breakpoint(pid_t pid, Breakpoint *sbp) {
+arch_enable_breakpoint(pid_t pid, Breakpoint *sbp)
+{
unsigned int i, j;
if (sbp->libsym) {
@@ -47,20 +38,22 @@
}
#endif /* ARCH_HAVE_ENABLE_BREAKPOINT */
+void
+enable_breakpoint(Process * proc, Breakpoint *sbp) {
+ if (sbp->libsym) {
+ debug(DEBUG_PROCESS, "enable_breakpoint: pid=%d, addr=%p, symbol=%s", proc->pid, sbp->addr, sbp->libsym->name);
+ } else {
+ debug(DEBUG_PROCESS, "enable_breakpoint: pid=%d, addr=%p", proc->pid, sbp->addr);
+ }
+ arch_enable_breakpoint(proc->pid, sbp);
+}
+
#ifdef ARCH_HAVE_DISABLE_BREAKPOINT
extern void arch_disable_breakpoint(pid_t, const Breakpoint *sbp);
+#else /* ARCH_HAVE_DISABLE_BREAKPOINT */
void
-disable_breakpoint(pid_t pid, const Breakpoint *sbp) {
- if (sbp->libsym) {
- debug(DEBUG_PROCESS, "disable_breakpoint: pid=%d, addr=%p, symbol=%s", pid, sbp->addr, sbp->libsym->name);
- } else {
- debug(DEBUG_PROCESS, "disable_breakpoint: pid=%d, addr=%p", pid, sbp->addr);
- }
- arch_disable_breakpoint(pid, sbp);
-}
-#else
-void
-disable_breakpoint(pid_t pid, const Breakpoint *sbp) {
+arch_disable_breakpoint(pid_t pid, const Breakpoint *sbp)
+{
unsigned int i, j;
if (sbp->libsym) {
@@ -84,3 +77,13 @@
}
}
#endif /* ARCH_HAVE_DISABLE_BREAKPOINT */
+
+void
+disable_breakpoint(Process * proc, Breakpoint *sbp) {
+ if (sbp->libsym) {
+ debug(DEBUG_PROCESS, "disable_breakpoint: pid=%d, addr=%p, symbol=%s", proc->pid, sbp->addr, sbp->libsym->name);
+ } else {
+ debug(DEBUG_PROCESS, "disable_breakpoint: pid=%d, addr=%p", proc->pid, sbp->addr);
+ }
+ arch_disable_breakpoint(proc->pid, sbp);
+}