summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--arch/nt32/bits/syscall.h.in28
-rw-r--r--arch/nt64/bits/syscall.h.in28
-rw-r--r--include/sys/debug.h7
-rw-r--r--src/arch/nt32/debug.c15
-rw-r--r--src/arch/nt64/debug.c15
5 files changed, 55 insertions, 38 deletions
diff --git a/arch/nt32/bits/syscall.h.in b/arch/nt32/bits/syscall.h.in
index ea88b63..19f2501 100644
--- a/arch/nt32/bits/syscall.h.in
+++ b/arch/nt32/bits/syscall.h.in
@@ -346,24 +346,26 @@
#define __NR_dbg_spawn 362
#define __NR_dbg_fork 363
-#define __NR_dbg_suspend 364
-#define __NR_dbg_kill 365
+#define __NR_dbg_kill 364
-#define __NR_dbg_rbreak 366
-#define __NR_dbg_tbreak 367
-#define __NR_dbg_lbreak 368
+#define __NR_dbg_rbreak 365
+#define __NR_dbg_tbreak 366
+#define __NR_dbg_lbreak 367
-#define __NR_dbg_event_query_one 369
-#define __NR_dbg_event_query_all 370
+#define __NR_dbg_suspend_thread 368
+#define __NR_dbg_resume_thread 369
-#define __NR_dbg_event_acquire 371
-#define __NR_dbg_event_respond 372
+#define __NR_dbg_event_query_one 370
+#define __NR_dbg_event_query_all 371
-#define __NR_dbg_query_cpid 373
-#define __NR_dbg_query_syspid 374
+#define __NR_dbg_event_acquire 372
+#define __NR_dbg_event_respond 373
-#define __NR_dbg_common_error 375
-#define __NR_dbg_native_error 376
+#define __NR_dbg_query_cpid 374
+#define __NR_dbg_query_syspid 375
+
+#define __NR_dbg_common_error 376
+#define __NR_dbg_native_error 377
#define SYS_cmd_args_to_argv 384
#define SYS_cmd_argv_to_args 385
diff --git a/arch/nt64/bits/syscall.h.in b/arch/nt64/bits/syscall.h.in
index ea88b63..19f2501 100644
--- a/arch/nt64/bits/syscall.h.in
+++ b/arch/nt64/bits/syscall.h.in
@@ -346,24 +346,26 @@
#define __NR_dbg_spawn 362
#define __NR_dbg_fork 363
-#define __NR_dbg_suspend 364
-#define __NR_dbg_kill 365
+#define __NR_dbg_kill 364
-#define __NR_dbg_rbreak 366
-#define __NR_dbg_tbreak 367
-#define __NR_dbg_lbreak 368
+#define __NR_dbg_rbreak 365
+#define __NR_dbg_tbreak 366
+#define __NR_dbg_lbreak 367
-#define __NR_dbg_event_query_one 369
-#define __NR_dbg_event_query_all 370
+#define __NR_dbg_suspend_thread 368
+#define __NR_dbg_resume_thread 369
-#define __NR_dbg_event_acquire 371
-#define __NR_dbg_event_respond 372
+#define __NR_dbg_event_query_one 370
+#define __NR_dbg_event_query_all 371
-#define __NR_dbg_query_cpid 373
-#define __NR_dbg_query_syspid 374
+#define __NR_dbg_event_acquire 372
+#define __NR_dbg_event_respond 373
-#define __NR_dbg_common_error 375
-#define __NR_dbg_native_error 376
+#define __NR_dbg_query_cpid 374
+#define __NR_dbg_query_syspid 375
+
+#define __NR_dbg_common_error 376
+#define __NR_dbg_native_error 377
#define SYS_cmd_args_to_argv 384
#define SYS_cmd_argv_to_args 385
diff --git a/include/sys/debug.h b/include/sys/debug.h
index d3b73e6..5317649 100644
--- a/include/sys/debug.h
+++ b/include/sys/debug.h
@@ -147,12 +147,15 @@ struct __dbg_event {
int __dbg_attach(pid_t);
int __dbg_detach(int);
-/* process creation/suspension/termination --> debug file descriptor */
+/* process creation/termination --> debug file descriptor */
int __dbg_spawn(const char *, char **, char **, const struct __strace *);
int __dbg_fork(void);
-int __dbg_suspend(int);
int __dbg_kill(int);
+/* suspend/resume thread; return previous suspend count (negative for an error) */
+int __dbg_suspend_thread(int, pid_t);
+int __dbg_resume_thread(int, pid_t);
+
/* breakpoint via remote break-in, thread context manipulation, or lpc message */
int __dbg_rbreak(int);
int __dbg_tbreak(int);
diff --git a/src/arch/nt32/debug.c b/src/arch/nt32/debug.c
index a7b0a21..efb773b 100644
--- a/src/arch/nt32/debug.c
+++ b/src/arch/nt32/debug.c
@@ -27,11 +27,6 @@ int __dbg_fork()
return syscall(SYS_dbg_fork);
}
-int __dbg_suspend(int pfd)
-{
- return syscall(SYS_dbg_suspend,pfd);
-}
-
int __dbg_kill(int pfd)
{
return syscall(SYS_dbg_kill,pfd);
@@ -52,6 +47,16 @@ int __dbg_lbreak(int pfd)
return syscall(SYS_dbg_lbreak,pfd);
}
+int __dbg_suspend_thread(int pfd, pid_t tid)
+{
+ return syscall(SYS_dbg_suspend_thread,pfd,tid);
+}
+
+int __dbg_resume_thread(int pfd, pid_t tid)
+{
+ return syscall(SYS_dbg_resume_thread,pfd,tid);
+}
+
int __dbg_event_query_one(int pfd, struct __dbg_event * evt)
{
return syscall(SYS_dbg_event_query_one,pfd,evt);
diff --git a/src/arch/nt64/debug.c b/src/arch/nt64/debug.c
index a7b0a21..efb773b 100644
--- a/src/arch/nt64/debug.c
+++ b/src/arch/nt64/debug.c
@@ -27,11 +27,6 @@ int __dbg_fork()
return syscall(SYS_dbg_fork);
}
-int __dbg_suspend(int pfd)
-{
- return syscall(SYS_dbg_suspend,pfd);
-}
-
int __dbg_kill(int pfd)
{
return syscall(SYS_dbg_kill,pfd);
@@ -52,6 +47,16 @@ int __dbg_lbreak(int pfd)
return syscall(SYS_dbg_lbreak,pfd);
}
+int __dbg_suspend_thread(int pfd, pid_t tid)
+{
+ return syscall(SYS_dbg_suspend_thread,pfd,tid);
+}
+
+int __dbg_resume_thread(int pfd, pid_t tid)
+{
+ return syscall(SYS_dbg_resume_thread,pfd,tid);
+}
+
int __dbg_event_query_one(int pfd, struct __dbg_event * evt)
{
return syscall(SYS_dbg_event_query_one,pfd,evt);