Author: Martin Platter
- Changes:
-
-
- $Id: dbg.h 4357 2006-01-22 23:33:38Z twisti $
+ Changes:
*/
/* at the moment linux/i386 is the only plattform available */
#if defined(__LINUX__) && defined (__I386__)
-#include <sys/ptrace.h>
-
-#define TRACEME ptrace(PTRACE_TRACEME, 0, 0, 0)
-#define GETREGS(pid, regs) ptrace(PTRACE_GETREGS, pid, 0, ®s)
-#define GETMEM(pid, addr) ptrace(PTRACE_PEEKDATA, pid, (caddr_t) addr, 0)
-#define ENABLEBRK(pid,ins,addr) ptrace(PTRACE_POKEDATA, pid, (caddr_t) addr, (ins & ~0x000000FF) | 0xcc)
-#define CONT(pid) ptrace(PTRACE_CONT, pid, 0, 0)
-#define DISABLEBRK(pid,ins,addr) ptrace(PTRACE_POKEDATA, pid, (caddr_t) addr, ins)
-#define GETIP(pid,ip) ptrace(PTRACE_GETREGS, pid, 0, ®s); \
- ip=regs.eip;
-#define SETIP(pid,ip) ip=regs.eip; \
- ptrace(PTRACE_SETREGS, pid, 0, ®s);
+
+#ifndef _DBG_H
+#define _DBG_H
+
+#define TRAPINS 0xcc /* opcode for brk */
+#define TRAP __asm__("int3")
+
+#endif
#endif
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ */