From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4F2553858C2A; Thu, 16 Nov 2023 09:53:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F2553858C2A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1700128386; bh=III0fq7b0LTP4vVDJEAkRMSCr/bwZfFYG9V4vWfVC80=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Yi4lWo0dnNjvJTGdRVmS409mU02JHk6MraxEkgPZjBmvcLCZ/ry0v20afMzpwrkEl ZyuDC+GWP841yE1AfdMT9rhNNAD+VYbXg0h05OWVFsnH785oK0DzrHcbbpmGekISlE X45yFoe5nqoVh5xGHBz2G8dRzYvfKxYliXXLK3iA= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug tdep/31071] [gdb/tdep, arm] FAIL: gdb.base/catch-syscall.exp: execve: syscall execve has returned Date: Thu, 16 Nov 2023 09:53:05 +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: vries at gcc dot gnu.org 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=3D31071 --- Comment #2 from Tom de Vries --- This demonstrator patch makes the test-case pass: ... diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index dfa816990ff..74c78166403 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -845,8 +845,12 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch, /* PC gets incremented before the syscall-stop, so read the previous instruction. */ - unsigned long this_instr =3D=20 - read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code); + unsigned long this_instr; + + ULONGEST val; + if (!safe_read_memory_unsigned_integer (pc - 4, 4, byte_order_for_co= de, &val)) + return 11; + this_instr =3D val; unsigned long svc_operand =3D (0x00ffffff & this_instr); ... --=20 You are receiving this mail because: You are on the CC list for the bug.=