]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: Fix false match issue in skip_prologue_using_linetable
authorWANG Rui <r@hev.cc>
Sat, 22 Apr 2023 07:33:45 +0000 (09:33 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 22 Apr 2023 07:33:45 +0000 (09:33 +0200)
commit3310ec8b5b6a7578c80a9da81c8357fa9205bba3
tree8d9181620ad11d52df9e21f00b8cefb7ba0594dc
parent6f0d75747fd42a0fd46f417b4dae5430515dfa76
gdb: Fix false match issue in skip_prologue_using_linetable

[ Changes in v2:
  - rebase on trunk
  Changes in v3:
  - add test-case ]

We should exclude matches to the ending PC to prevent false matches with the
next function, as prologue_end is located at the end PC.

  <fun1>:
    0x00: ... <-- start_pc
    0x04: ...
    0x08: ... <-- breakpoint
    0x0c: ret
  <fun2>:
    0x10: ret <-- end_pc | prologue_end of fun2

Tested on x86_64-linux.

Co-Authored-By: WANG Rui <r@hev.cc> (fix, tiny change [1])
Co-Authored-By: Tom de Vries <tdevries@suse.de> (test-case)
Approved-by: Kevin Buettner <kevinb@redhat.com>
[1] https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html

PR symtab/30369
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30369
gdb/symtab.c
gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.exp [new file with mode: 0644]