[review] gdb: Don't reorder line table entries too much when sorting.
Christian Biesinger (Code Review)
gerrit@gnutoolchain-gerrit.osci.io
Fri Nov 8 00:28:00 GMT 2019
Christian Biesinger has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/526
......................................................................
Patch Set 1:
(1 comment)
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/526/1/gdb/buildsym.c
File gdb/buildsym.c:
https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/526/1/gdb/buildsym.c@957
PS1, Line 957:
902 | buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
| ...
952 | return true;
953 |
954 | if (ln1.pc > ln2.pc)
955 | return false;
956 |
957 > /* For line table entries at the same address we don't want
958 | to reorder them. */
959 | ptrdiff_t off1 = &ln1 - &subfile->line_vector->item[0];
960 | ptrdiff_t off2 = &ln2 - &subfile->line_vector->item[0];
961 | return off1 < off2;
962 | };
Perhaps use std::stable_sort instead of doing it this way? (Unless I misunderstood the purpose of this)
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: Ia0309494be4cfd9dcc554f30209477f5f040b21b
Gerrit-Change-Number: 526
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-CC: Christian Biesinger <cbiesinger@google.com>
Gerrit-Comment-Date: Fri, 08 Nov 2019 00:28:21 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
More information about the Gdb-patches
mailing list