Re: Unbreaking gdb on Solaris post-multitarget [PR 25939]

Pedro Alves
2020-06-18T14:55:39Z

On 6/17/20 3:45 PM, Rainer Orth wrote:
> [Thread debugging using libthread_db enabled]
> [New Thread 1 (LWP 1)]
> Breakpoint 1 at 0x401036: file hello.c, line 6.
> bottom-gdb.gdb:3: Error in sourced command file:
> procfs: couldn't find pid 0 in procinfo list.

I see what this is. This is procfs_target::wait relying on
inferior_ptid. Since the multi-target series, inferior_ptid
is null_ptid before we call target_wait:

static ptid_t
do_target_wait_1 (inferior *inf, ptid_t ptid,
target_waitstatus *status, int options)
{
ptid_t event_ptid;
struct thread_info *tp;

/* We know that we are looking for an event in the target of inferior
INF, but we don't know which thread the event might come from. As
such we want to make sure that INFERIOR_PTID is reset so that none of
the wait code relies on it - doing so is always a mistake. */
switch_to_inferior_no_thread (inf);

I'm working on a patch.

Thanks,
Pedro Alves