ptid_t::parse fails to correctly handle the -1 return from
hex_or_minus_one in the 'p' case. As Mark Wielaard pointed out, it
does this check:
if (hex != ((unsigned_lwp_type) lwp))
However on 32-bit, this means that it will mishandle (ULONGEST) -1.
This patch fixes the problem by adding a check for the -1 case.
I built a -m32 gdb and verified this fix; I'm checking it in.
error (_("invalid remote ptid: %s"), buf);
lwp = (ptid_t::lwp_type) hex;
- if (hex != ((unsigned_lwp_type) lwp))
+ if (hex != ((unsigned_lwp_type) lwp) && hex != (ULONGEST) -1)
error (_("invalid remote ptid: %s"), buf);
if (obuf != nullptr)