gdb, infcmd: Support jump command with same line in multiple symtabs
authorMatti Puputti <matti.puputti@intel.com>
Fri, 12 May 2023 13:33:20 +0000 (15:33 +0200)
committerAndrew Burgess <aburgess@redhat.com>
Wed, 24 May 2023 16:02:21 +0000 (17:02 +0100)
commit389971df23ca74092314dbde1303310a33766ba7
tree84a5bfe3138619a51de2ff04661ee35f9bfc8394
parentea33730dfa4b2e639f99bb4c1f4f8f073ef5b937
gdb, infcmd: Support jump command with same line in multiple symtabs

If a header file defining a static function is included in multiple source
files, each calling the function, and GDB is asked to jump to a line inside
that function, there would be multiple locations matching the target.  The
solution in this commit is to select the location in the current symtab.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Andrew Burgess <aburgess@redhat.com>
gdb/doc/gdb.texinfo
gdb/infcmd.c
gdb/testsuite/gdb.base/jump_multiple_objfiles-foo.c [new file with mode: 0755]
gdb/testsuite/gdb.base/jump_multiple_objfiles.c [new file with mode: 0755]
gdb/testsuite/gdb.base/jump_multiple_objfiles.exp [new file with mode: 0755]
gdb/testsuite/gdb.base/jump_multiple_objfiles.h [new file with mode: 0755]