This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Skip server-kill.exp on remote target


On 09/30/2014 02:10 PM, Yao Qi wrote:
> I thought about different ways to handle remote target, for example:
> 
>  - use command ps on remote target to gdbserver pid, but it doesn't work
>    if we have multiple gdbserver instances during testing,
>  - port number can be regarded as an id to differentiate different
>    instances, but port number is unknown to each test case.  Likewise,
>    we can't use 'pkill' due to the same reason.
>  - close the gdbserver channel, but gdbserver doesn't exit on the target,

gdbserver will be the parent of the tested process.  So how about
tweaking the test program to do:

int server_pid;

int main ()
{
   server_pid = getppid ();
}

and then simply read "server_pid" out of the inferior ?

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]