我使用用户模式Linux(UML)通过使用gdb在Ubuntu 16.04中调试和破解linux-4.13.4。
我按照说明进行操作
获取源代码
wget https://www.kernel.org/pub/linux/kernel/v4.x/linux-4.13.4.tar.xz
编译并安装
制作mrproper
make mrproper ARCH = um
make defconfig ARCH = um
make menuconfig ARCH = um
制作ARCH = um
制作模块ARCH = um
Debian Wheezy
文件系统
启动UML并调试
我在gdb的sys_clone
处设置断点,并在UML = {>>处输入ls
root@changeme:~# ls
到达断点。
(gdb) c
Continuing.
Breakpoint 1, SyS_clone (clone_flags=18874385, newsp=0, parent_tidptr=0, child_tidptr=1073896944, tls=0)
at kernel/fork.c:2139
2139 SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
然后我使用s
,n
,finish
来加速gdb过程。
但是,我发现程序陷阱在下面的循环中,直到我键入continue
。 为什么?
循环:
(gdb)
Run till exit from #0 0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>,
regs=<optimized out>, pid=<optimized out>) at arch/um/os-Linux/skas/process.c:173
hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>, p=0x603c5ac0 <cpu0_irqstack+6848>)
at arch/um/os-Linux/signal.c:161
161 {
(gdb)
Run till exit from #0 hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>,
p=0x603c5ac0 <cpu0_irqstack+6848>) at arch/um/os-Linux/signal.c:161
<signal handler called>
(gdb)
Run till exit from #0 <signal handler called>
0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>, regs=<optimized out>, pid=<optimized out>)
at arch/um/os-Linux/skas/process.c:173
173 handle_syscall(regs);
(gdb)
完整详情:
Breakpoint 1, SyS_clone (clone_flags=18874385, newsp=0, parent_tidptr=0, child_tidptr=1073899664, tls=0)
at kernel/fork.c:2139
2139 SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
(gdb) s
SYSC_clone (tls=<optimized out>, child_tidptr=<optimized out>, parent_tidptr=<optimized out>,
newsp=<optimized out>, clone_flags=<optimized out>) at kernel/fork.c:2145
2145 return _do_fork(clone_flags, newsp, 0, parent_tidptr, child_tidptr, tls);
(gdb) n
SyS_clone (clone_flags=18874385, newsp=0, parent_tidptr=<optimized out>, child_tidptr=<optimized out>,
tls=<optimized out>) at kernel/fork.c:2139
2139 SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
(gdb) finish
Run till exit from #0 SyS_clone (clone_flags=18874385, newsp=0, parent_tidptr=<optimized out>,
child_tidptr=<optimized out>, tls=<optimized out>) at kernel/fork.c:2139
0x00000000600211c8 in handle_syscall (r=0x800af370) at arch/um/kernel/skas/syscall.c:32
32 PT_REGS_SET_SYSCALL_RETURN(regs,
Value returned is $5 = 1673
(gdb)
Run till exit from #0 0x00000000600211c8 in handle_syscall (r=0x800af370) at arch/um/kernel/skas/syscall.c:32
0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>, regs=<optimized out>, pid=<optimized out>)
at arch/um/os-Linux/skas/process.c:173
173 handle_syscall(regs);
(gdb)
Run till exit from #0 0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>,
regs=<optimized out>, pid=<optimized out>) at arch/um/os-Linux/skas/process.c:173
hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>, p=0x603c5ac0 <cpu0_irqstack+6848>)
at arch/um/os-Linux/signal.c:161
161 {
(gdb)
Run till exit from #0 hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>,
p=0x603c5ac0 <cpu0_irqstack+6848>) at arch/um/os-Linux/signal.c:161
<signal handler called>
(gdb)
Run till exit from #0 <signal handler called>
0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>, regs=<optimized out>, pid=<optimized out>)
at arch/um/os-Linux/skas/process.c:173
173 handle_syscall(regs);
(gdb)
Run till exit from #0 0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>,
regs=<optimized out>, pid=<optimized out>) at arch/um/os-Linux/skas/process.c:173
hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>, p=0x603c5ac0 <cpu0_irqstack+6848>)
at arch/um/os-Linux/signal.c:161
161 {
(gdb)
Run till exit from #0 hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>,
p=0x603c5ac0 <cpu0_irqstack+6848>) at arch/um/os-Linux/signal.c:161
<signal handler called>
(gdb)
Run till exit from #0 <signal handler called>
0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>, regs=<optimized out>, pid=<optimized out>)
at arch/um/os-Linux/skas/process.c:173
173 handle_syscall(regs);
(gdb)
Run till exit from #0 0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>,
regs=<optimized out>, pid=<optimized out>) at arch/um/os-Linux/skas/process.c:173
hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>, p=0x603c5ac0 <cpu0_irqstack+6848>)
at arch/um/os-Linux/signal.c:161
161 {
(gdb) where
#0 hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>, p=0x603c5ac0 <cpu0_irqstack+6848>)
at arch/um/os-Linux/signal.c:161
#1 <signal handler called>
#2 0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>, regs=<optimized out>,
pid=<optimized out>) at arch/um/os-Linux/skas/process.c:173
#3 userspace (regs=0x800af370) at arch/um/os-Linux/skas/process.c:417
#4 0x000000006001ded1 in fork_handler () at arch/um/kernel/process.c:153
#5 0x0000000000000000 in ?? ()
(gdb) fin
Run till exit from #0 hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>,
p=0x603c5ac0 <cpu0_irqstack+6848>) at arch/um/os-Linux/signal.c:161
<signal handler called>
(gdb) where
#0 <signal handler called>
#1 0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>, regs=<optimized out>,
pid=<optimized out>) at arch/um/os-Linux/skas/process.c:173
#2 userspace (regs=0x800af370) at arch/um/os-Linux/skas/process.c:417
#3 0x000000006001ded1 in fork_handler () at arch/um/kernel/process.c:153
#4 0x0000000000000000 in ?? ()
(gdb) finish
Run till exit from #0 <signal handler called>
0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>, regs=<optimized out>, pid=<optimized out>)
at arch/um/os-Linux/skas/process.c:173
173 handle_syscall(regs);
(gdb)
Run till exit from #0 0x0000000060034663 in handle_trap (local_using_sysemu=<optimized out>,
regs=<optimized out>, pid=<optimized out>) at arch/um/os-Linux/skas/process.c:173
hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>, p=0x603c5ac0 <cpu0_irqstack+6848>)
at arch/um/os-Linux/signal.c:161
161 {
(gdb)
Run till exit from #0 hard_handler (sig=14, si=0x603c5bf0 <cpu0_irqstack+7152>,
p=0x603c5ac0 <cpu0_irqstack+6848>) at arch/um/os-Linux/signal.c:161
<signal handler called>
Function userspace does not return normally
尽管如此,我陷入了循环,我只使用next
。我试着finish
但是
函数用户空间无法正常返回
393 if (get_fp_registers(pid, regs->fp)) {
(gdb) fin
warning: Function userspace does not return normally.
Try to finish anyway? (y or n) y
Run till exit from #0 userspace (regs=0x800af370) at arch/um/os-Linux/skas/process.c:393
完全取消:
Breakpoint 1, SyS_clone (clone_flags=18874385, newsp=0, parent_tidptr=0, child_tidptr=1073899664, tls=0)
at kernel/fork.c:2139
2139 SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
(gdb) n
handle_syscall (r=0x800af370) at arch/um/kernel/skas/syscall.c:36
36 syscall_trace_leave(regs);
(gdb)
37 }
(gdb)
userspace (regs=0x800af370) at arch/um/os-Linux/skas/process.c:438
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
399 UPT_SYSCALL_NR(regs) = -1; /* Assume: It's not a syscall */
(gdb)
401 if (WIFSTOPPED(status)) {
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
402 int sig = WSTOPSIG(status);
(gdb)
404 ptrace(PTRACE_GETSIGINFO, pid, 0, (struct siginfo *)&si);
(gdb)
406 switch (sig) {
(gdb)
438 pid = userspace_pid[0];
(gdb)
439 interrupt_end();
(gdb)
443 PT_SYSCALL_NR(regs->gp) = -1;
(gdb)
355 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp)) {
(gdb)
361 if (put_fp_registers(pid, regs->fp)) {
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
368 local_using_sysemu = get_using_sysemu();
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
370 op = SELECT_PTRACE_OPERATION(local_using_sysemu,
(gdb)
373 if (ptrace(op, pid, 0, 0)) {
(gdb)
379 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
386 regs->is_user = 1;
(gdb)
387 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
(gdb)
393 if (get_fp_registers(pid, regs->fp)) {
(gdb) fin
warning: Function userspace does not return normally.
Try to finish anyway? (y or n) y
Run till exit from #0 userspace (regs=0x800af370) at arch/um/os-Linux/skas/process.c:393