aboutsummaryrefslogtreecommitdiffstats
path: root/exec/trace.c
diff options
context:
space:
mode:
authorPo Lu2025-04-15 16:14:14 +0800
committerPo Lu2025-04-15 16:17:14 +0800
commit5bf86e2be0693c579a43759fd1da1651344d401e (patch)
tree689475ec3fc7632cdf63a8796583bcb62f56f878 /exec/trace.c
parentc3fe19aab90c3da68e9a8a48dbfb011317041d1a (diff)
downloademacs-5bf86e2be0693c579a43759fd1da1651344d401e.tar.gz
emacs-5bf86e2be0693c579a43759fd1da1651344d401e.zip
Port recent Android changes to mips64el
* exec/config-mips.m4.in (DADDI2, DADDI3): Disable at-clobbering by assembler macros expressly. * exec/loader-mips64el.s: Adapt from loader-mipsel.s. * exec/configure.ac (exec_cv_as_daddi): Properly escape reg names. * exec/exec.c (struct exec_jump_command, exec_0): Don't define or set `fpu_mode' if __LP64__. * exec/exec.h (struct exec_tracee): New field `callno'. * exec/trace.c (process_system_call): Always record the current system call number in TRACEE lest it should be required once it has been overwritten upon the syscall's completion. (seccomp_system_call): Likewise. (after_fork): Clear `tracee->callno'.
Diffstat (limited to 'exec/trace.c')
-rw-r--r--exec/trace.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/exec/trace.c b/exec/trace.c
index b0ec602d821..2421785a80a 100644
--- a/exec/trace.c
+++ b/exec/trace.c
@@ -1246,7 +1246,11 @@ process_system_call (struct exec_tracee *tracee)
1246 set, this must be exec, whatever the value of SYSCALL_NUM_REG, 1246 set, this must be exec, whatever the value of SYSCALL_NUM_REG,
1247 which is erased when exec loads another image. */ 1247 which is erased when exec loads another image. */
1248 1248
1249 callno = (!tracee->exec_data ? regs.SYSCALL_NUM_REG : EXEC_SYSCALL); 1249 callno = (!tracee->exec_data
1250 ? (!tracee->waiting_for_syscall
1251 ? regs.SYSCALL_NUM_REG : tracee->callno)
1252 : EXEC_SYSCALL);
1253 tracee->callno = callno;
1250 switch (callno) 1254 switch (callno)
1251 { 1255 {
1252 case EXEC_SYSCALL: 1256 case EXEC_SYSCALL:
@@ -1653,6 +1657,11 @@ seccomp_system_call (struct exec_tracee *tracee)
1653 1657
1654 /* Now dispatch based on the system call. */ 1658 /* Now dispatch based on the system call. */
1655 callno = regs.SYSCALL_NUM_REG; 1659 callno = regs.SYSCALL_NUM_REG;
1660
1661 /* Record the call number, which may be required if one of the
1662 following handlers should arrange for process_system_call to
1663 intercede after the system call completes. */
1664 tracee->callno = callno;
1656 switch (callno) 1665 switch (callno)
1657 { 1666 {
1658 case EXEC_SYSCALL: 1667 case EXEC_SYSCALL:
@@ -1715,7 +1724,7 @@ seccomp_system_call (struct exec_tracee *tracee)
1715 if (rc < 0) 1724 if (rc < 0)
1716 return; 1725 return;
1717 1726
1718 tracee->waiting_for_syscall = !tracee->waiting_for_syscall; 1727 tracee->waiting_for_syscall = true;
1719 break; 1728 break;
1720 1729
1721 default: 1730 default:
@@ -2033,6 +2042,7 @@ after_fork (pid_t pid)
2033 return 1; 2042 return 1;
2034 2043
2035 tracee->pid = pid; 2044 tracee->pid = pid;
2045 tracee->callno = 0;
2036 tracee->next = tracing_processes; 2046 tracee->next = tracing_processes;
2037 tracee->waiting_for_syscall = false; 2047 tracee->waiting_for_syscall = false;
2038 tracee->new_child = false; 2048 tracee->new_child = false;