gdb: include location number in breakpoint error message
authorAndrew Burgess <aburgess@redhat.com>
Fri, 7 Jul 2023 15:36:26 +0000 (16:36 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 10 Jul 2023 09:49:59 +0000 (10:49 +0100)
commit3f3ffaca04967511fa14b5cb6ee4cd1ae3802c39
tree60388b35e1c37a66f99d291a4265064c693ebbff
parentc432a27df338c6720303c29eab18467cfc981cb8
gdb: include location number in breakpoint error message

This commit improves the output of this previous commit:

  commit 2dc3457a454a35d0617dc1f9cc1db77468471f95
  Date:   Fri Oct 14 13:22:55 2022 +0100

      gdb: include breakpoint number in testing condition error message

The earlier commit extended the error message:

  Error in testing breakpoint condition:

to include the breakpoint number, e.g.:

  Error in testing breakpoint condition 3:

This commit extends takes this further, and includes the location
number if the breakpoint has multiple locations, so we might now see:

  Error in testing breakpoint condition 3.2:

Just as with how GDB reports a normal breakpoint stop, if a breakpoint
only has a single location then the location number is not included,
this keeps things nice and consistent.

I've extended one of the tests to cover the new functionality.

Approved-By: Pedro Alves <pedro@palves.net>
gdb/breakpoint.c
gdb/testsuite/gdb.base/bp-cond-failure.c
gdb/testsuite/gdb.base/bp-cond-failure.exp