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 2/3] gdb: Don't reorder line table entries too much when sorting.


>>>>> "Andrew" == Andrew Burgess <andrew.burgess@embecosm.com> writes:

Andrew> Don't reorder line table entries for the same address when sorting the
Andrew> line table, maintain the compiler given line order.  Usually this will
Andrew> reflect the order in which lines are conceptually encountered at a
Andrew> given address.

Thanks for the long explanation and the patch.

I had a couple minor nits.

Andrew> -	  /* Like the pending blocks, the line table may be
Andrew> -	     scrambled in reordered executables.  Sort it if
Andrew> -	     OBJF_REORDERED is true.  */
Andrew> +	  const auto lte_is_less_than
Andrew> +	    = [] (const linetable_entry &ln1,
Andrew> +		  const linetable_entry &ln2)->bool

I'd put spaces around the "->".


Andrew> +	      {
Andrew> +		/* Note: this code does not assume that CORE_ADDRs can fit
Andrew> +		   in ints.  Please keep it that way.  */
Andrew> +		return (ln1.pc < ln2.pc);

I don't think this comment adds anything any more.  IMO it can just be
dropped.

Tom


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