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][PING][PR gdb/19361] Fix invalid comparison functions


On 12/30/2015 08:18 PM, Yuri Gribov wrote:

> Sorry, I should have been more wordy about the actual problem. With
> current approach i.e.
> 
>   if (pid1 == pgid1)
>     return -1;
>   else if (pid2 == pgid2)
>     return 1;
> 
> comparison of two group leaders is not going to be symmetric:
> 
>   cmp(lead_1, lead_2) == cmp(lead_2, lead_1) == -1

Aaaaaaah, d'oh!  Thanks, it's obvious now, yes, we fail to consider
the case of both elements being leaders.  I couldn't see that
even after staring at the code for a while.  That hunk is OK as
is then.  (Please clarify this in the commit log.)

Thanks,
Pedro Alves


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