[Bug gdb/28404] New: Verify bsearch precondition in find_pc_section

vries at gcc dot gnu.org sourceware-bugzilla@sourceware.org
Fri Oct 1 09:25:13 GMT 2021


https://sourceware.org/bugzilla/show_bug.cgi?id=28404

            Bug ID: 28404
           Summary: Verify bsearch precondition in find_pc_section
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

While debugging some problem I came across a bsearch in find_pc_section, which
relies on the sections array being in ascending sorted order.

Visual inspection revealed that the precondition was not met.

It would probably be good to write an assert checking the precondition, and use
it to see if indeed it triggers.

Perhaps even add a verify_bsearch to gdbsupport that can be dropped in place to
check the precondition.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list