Re: [patch] update_global_location_list my comment fix [Re: [PATCH] Fix breakpoint updates for multi-inferior]

Jan Kratochvil
2012-02-09T08:23:04Z

On Thu, 09 Feb 2012 00:39:42 +0100, Luis Gustavo wrote:
> + /* Sort by pspace. This effectively sorts locations by inferior in
> + a multi-inferior environment. */
> +
> + if (a->pspace != b->pspace)
> + return (a->pspace > b->pspace) - (a->pspace < b->pspace);

This does not follow the comment I made:

/* Make the internal GDB representation stable across GDB runs
where A and B memory inside GDB can differ.

I would prefer there (and it will not fit on a single line :-) ):

return (a->pspace->num > b->pspace->num) - (a->pspace->num < b->pspace->num);

NUM should be the same on each GDB run for the same inferior / command file.

Thanks,
Jan