diff options
author | Andrew Burgess <aburgess@redhat.com> | 2023-07-07 16:36:26 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2023-07-10 10:49:59 +0100 |
commit | 3f3ffaca04967511fa14b5cb6ee4cd1ae3802c39 (patch) | |
tree | 60388b35e1c37a66f99d291a4265064c693ebbff /gdb/breakpoint.c | |
parent | c432a27df338c6720303c29eab18467cfc981cb8 (diff) | |
download | gdb-3f3ffaca04967511fa14b5cb6ee4cd1ae3802c39.zip gdb-3f3ffaca04967511fa14b5cb6ee4cd1ae3802c39.tar.gz gdb-3f3ffaca04967511fa14b5cb6ee4cd1ae3802c39.tar.bz2 |
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>
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index da6c8de..d898167 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -5544,9 +5544,17 @@ bpstat_check_breakpoint_conditions (bpstat *bs, thread_info *thread) } catch (const gdb_exception_error &ex) { - exception_fprintf (gdb_stderr, ex, - "Error in testing condition for breakpoint %d:\n", - b->number); + int locno = bpstat_locno (bs); + if (locno != 0) + exception_fprintf + (gdb_stderr, ex, + "Error in testing condition for breakpoint %d.%d:\n", + b->number, locno); + else + exception_fprintf + (gdb_stderr, ex, + "Error in testing condition for breakpoint %d:\n", + b->number); /* If the pc value changed as a result of evaluating the condition then we probably stopped within an inferior |