[Bug remote/33979] GDB client sends malformed thread-id when tid >31 bit unsigned integer

danielprilik at gmail dot com via Gdb-prs <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=33979

--- Comment #10 from Daniel Prilik <danielprilik at gmail dot com> ---
(In reply to Tom Tromey from comment #9)
> Possibly we may just cap these things at 32 bits.

Maybe we're already on the same page, but just to make sure... wouldn't it need
to be capped at 31 bits unsigned? Given that `-1` and `0` are special
sentinels.

Since that's really the crux of the issue here: projects are sending 32 bit
unsigned (or greater) `pid_t` values, and then running into issues since
`pid_t` is signed?

For my money, it seems easier to stick to 31 bits, which is consistent with
GDB's existing internal representation, and unlikely to introduce downstream
regressions in GDB (e.g: with code that ends up casting a 32-bit unsigned
pid/tid to back to a bare signed int)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.