This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] gdb: Don't reorder line table entries too much when sorting.
- From: Tom Tromey <tom at tromey dot com>
- To: Andrew Burgess <andrew dot burgess at embecosm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 24 Jan 2020 10:35:08 -0700
- Subject: Re: [PATCH 2/3] gdb: Don't reorder line table entries too much when sorting.
- References: <cover.1577065748.git.andrew.burgess@embecosm.com> <dda2d813c27d4c40ef50d350e698abec62593459.1577065748.git.andrew.burgess@embecosm.com>
>>>>> "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