summaryrefslogtreecommitdiffhomepage
path: root/src/arch/nt32/debug.c
blob: ba72d4bd16f413938fe846b3a94682c349f7fcca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/**************************************************************************/
/*  mmglue: midipix architecture- and target-specific bits for musl libc  */
/*  Copyright (C) 2013--2023  SysDeer Technologies, LLC                   */
/*  Released under the Standard MIT License; see COPYING.MMGLUE.          */
/**************************************************************************/

#include <stdint.h>
#include <stddef.h>
#include <signal.h>
#include <unistd.h>
#include <sys/debug.h>
#include "syscall.h"

int __dbg_attach(pid_t pid)
{
	return syscall(SYS_dbg_attach,pid);
}

int __dbg_detach(int pfd)
{
	return syscall(SYS_dbg_detach,pfd);
}

int __dbg_spawn(const char * path,
		char ** argv, char ** envp,
		const struct __strace * strace)
{
	return syscall(SYS_dbg_spawn,path,argv,envp,strace);
}

int __dbg_fork()
{
	return syscall(SYS_dbg_fork);
}

int __dbg_kill(int pfd)
{
	return syscall(SYS_dbg_kill,pfd);
}

int __dbg_rbreak(int pfd)
{
	return syscall(SYS_dbg_rbreak,pfd);
}

int __dbg_tbreak(int pfd)
{
	return syscall(SYS_dbg_tbreak,pfd);
}

int __dbg_lbreak(int pfd)
{
	return syscall(SYS_dbg_lbreak,pfd);
}

ssize_t __dbg_vm_read(int pfd, void * buf, size_t len, uintptr_t addr)
{
	return syscall(SYS_dbg_vm_read,pfd,buf,len,addr);
}

ssize_t __dbg_vm_write(int pfd, const void * buf, size_t len, uintptr_t addr)
{
	return syscall(SYS_dbg_vm_write,pfd,buf,len,addr);
}

int __dbg_regs_fetch(int pfd, pid_t tid, mcontext_t * regctx)
{
	return syscall(SYS_dbg_regs_fetch,pfd,tid,regctx);
}

int __dbg_regs_store(int pfd, pid_t tid, const mcontext_t * regctx)
{
	return syscall(SYS_dbg_regs_store,pfd,tid,regctx);
}

ssize_t __dbg_info_get(int pfd, pid_t tid, int type, void * buf, size_t len)
{
	return syscall(SYS_dbg_info_get,pfd,tid,type,buf,len);
}

ssize_t __dbg_info_set(int pfd, pid_t tid, int type, const void * buf, size_t len)
{
	return syscall(SYS_dbg_info_set,pfd,tid,type,buf,len);
}

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);
}

int __dbg_event_query_all(int pfd, struct __dbg_event evt[], int nelem)
{
	return syscall(SYS_dbg_event_query_all,pfd,evt,nelem);
}

int __dbg_event_acquire(int pfd, struct __dbg_event * evt)
{
	return syscall(SYS_dbg_event_acquire,pfd,evt);
}

int __dbg_event_respond(int pfd, struct __dbg_event * evt)
{
	return syscall(SYS_dbg_event_respond,pfd,evt);
}

int __dbg_query_cpid(int pfd)
{
	return syscall(SYS_dbg_query_cpid,pfd);
}

int __dbg_query_syspid(int pfd)
{
	return syscall(SYS_dbg_query_syspid,pfd);
}

int __dbg_common_error(void)
{
	return syscall(SYS_dbg_common_error);
}

int __dbg_native_error(void)
{
	return syscall(SYS_dbg_native_error);
}