From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4532C384DED1; Thu, 15 Feb 2024 16:59:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4532C384DED1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708016352; bh=wH+uN+CI6exd1uFm0SBc/v5PvZPa/+jQTvUDSWm6Ugs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ufL0xqPC/cY2xSYO/f0pwCg2VHnmhgpFbFx6quz0l1/A1hHAZg/mDAW7uyabLK1Cn 3z94xOlvGn0Vkb2cos6bMu+qWyFvMPa7RygOYNu57NM8lxq+KjQWr3Fx6+SO00hCmV giN294iHb8+C/lSqJvLhufr+nFZd9lqWPRsgoJ/8= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug remote/25111] [Zephyr/thread aware debugging] remote: write_ptid returns negative tid. Date: Thu, 15 Feb 2024 16:59:11 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: remote X-Bugzilla-Version: 8.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at sourceware dot 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=3D25111 --- Comment #8 from Tom Tromey --- I looked a little. Changing ptid_t::pid_type to be unsigned is probably a colossal change, bordering on the impossible. However, it does seem that negative values aren't really intended -- except for the special case of -1. The manual says: The PID (process) and TID (thread) components each have the format described above: a positive number with target-specific interpretation formatted as a big-endian hex string, literal =E2=80=98-1=E2=80=99 to indicate all processes or threads (respectively), or =E2=80=980=E2=80=99 to indicate an arbitrary process or = thread. So in remote_target::write_ptid, I wonder if it's sufficient to change the "pid < 0" check to "pid =3D=3D -1" (and likewise for tid). --=20 You are receiving this mail because: You are on the CC list for the bug.=