From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C8C4E3858CD1; Fri, 17 Nov 2023 14:32:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C8C4E3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700231537; bh=ZeTlwOy77FSwPnPagowURnUVoskoGkKgXn/FUB8ib4g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CU6DGyogCF774eq2Z9HtSWmmYZ22uD5snUc/q9wT3QzMaFRDXY4lWuvWSQYJlV1Uh u4oo8jLEmZaMJea+ucY3IFg17zZWoIkxOD8P+Y78ux8bTAuK5doeGNYSCyPIPT3qPJ AHSItrmSlGkgzWKXB6iLUabzNsyMajL2wYMjcrrk= From: "ulrich.weigand at de dot ibm.com" To: gdb-prs@sourceware.org Subject: [Bug tdep/28623] Missing catching return of execve syscall of PowerPC Date: Fri, 17 Nov 2023 14:32:16 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ulrich.weigand at de dot ibm.com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28623 --- Comment #7 from ulrich.weigand at de dot ibm.com --- This is certainly better, but still somewhat fragile in that it still requi= res the platform back-end to reliably detect that it cannot detect the system c= all number. On some targets (e.g. s390x) that read the system call number from memory as immediate operand of the syscall instruction, you may encounter t= he even worse scenario that after an execve you *do* detect a syscall but it is wrong (because at that same location in memory the new executable also cont= ains a syscall instruction, but a different one) ... I still think ideally we should be able to make use of the PTRACE_EVENT_EXEC reported by the kernel. If I'm reading kernel code correctly, we should be getting the following sequence of ptrace events: - syscall SIGTRAP - before execve - PTRACE_EVENT_EXEC - syscall SIGTRAP - after execve So maybe processing of PTRACE_EVENT_EXEC should set a flag that if syscall traps are active, the immediate next such event in the current process shou= ld not even attempt to call gdbarch_get_syscall_number, but simply assume that= it is a return of the immediately preceding execve syscall. --=20 You are receiving this mail because: You are on the CC list for the bug.=