[Bug remote/33983] Move more code to gdbsupport
"cvs-commit at gcc dot gnu.org via Gdb-prs" <[email protected]>
| Newsgroups | gmane.comp.gdb.bugs.discuss |
|---|---|
| Message-ID | <[email protected]/bugzilla/> |
https://sourceware.org/bugzilla/show_bug.cgi?id=33983 --- Comment #2 from Sourceware Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tom Tromey <[email protected]>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c2d4b5e1135f75f7e4ef7ff68fa899bfe483671b commit c2d4b5e1135f75f7e4ef7ff68fa899bfe483671b Author: Tom Tromey <[email protected]> Date: Wed Mar 11 14:17:50 2026 -0600 Do not write negative PID or TID in remote protocol Currently both gdb and gdbserver can write a negative number for the PID or TID. However, the only negative value that really makes sense is the special case of "-1" -- in other cases if the PID or TID has the high bit set, it should still be written as a positive number. This patch attempts to fix the bug. v2 of this patch combines the implementations and moves them to gdbsupport. I tried making these standalone functions in rsp-low.cc, but that runs afoul of libipa. So, I made them methods of ptid_t. The new unit tests pointed out that round-tripping a sign-extended number didn't really work, because the checks were done via ULONGEST. It's kind of unfortunate that the PID and LWP are host-dependent types. This should probably be fixed, but I haven't done so here. Meanwhile I changed the checks to use the corresponding unsigned type. v1 is here https://inbox.sourceware.org/gdb-patches/[email protected]/ Regression tested on x86-64 Fedora 43. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=25111 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33979 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33983 -- You are receiving this mail because: You are on the CC list for the bug.