aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@palves.net>2022-05-24 19:30:10 +0100
committerPedro Alves <pedro@palves.net>2022-05-25 19:51:46 +0100
commitfbcda577011d73fdcf1ebf86160b6fc8ddd95299 (patch)
treef9a7342f657fa0088f45eb6ae03899223f242235 /gdb/breakpoint.c
parent3ac9da49378ccb061e3e33e4342c35949bf368a9 (diff)
downloadfsf-binutils-gdb-fbcda577011d73fdcf1ebf86160b6fc8ddd95299.zip
fsf-binutils-gdb-fbcda577011d73fdcf1ebf86160b6fc8ddd95299.tar.gz
fsf-binutils-gdb-fbcda577011d73fdcf1ebf86160b6fc8ddd95299.tar.bz2
Show enabled locations with disabled breakpoint parent as "y-"
Currently, breakpoint locations that are enabled while their parent breakpoint is disabled are displayed with "y" in the Enb colum of "info breakpoints": (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep n <MULTIPLE> 1.1 y 0x00000000000011b6 in ... 1.2 y 0x00000000000011c2 in ... 1.3 n 0x00000000000011ce in ... Such locations won't trigger a break, so to avoid confusion, show "y-" instead. For example: (gdb) info breakpoints Num Type Disp Enb Address What 1 breakpoint keep n <MULTIPLE> 1.1 y- 0x00000000000011b6 in ... 1.2 y- 0x00000000000011c2 in ... 1.3 n 0x00000000000011ce in ... The "-" sign is inspired on how the TUI represents breakpoints on the left side of the source window, with "b-" for a disabled breakpoint. Change-Id: I9952313743c51bf21b4b380c72360ef7d4396a09
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index eac6410..ed932a1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6234,13 +6234,38 @@ print_one_breakpoint_location (struct breakpoint *b,
/* 4 */
annotate_field (3);
- /* For locations that are disabled because of an invalid condition,
- display "N*" on CLI, where "*" refers to a footnote below the
- table. For MI, simply display a "N" without a footnote. */
- const char *N = (uiout->is_mi_like_p ()) ? "N" : "N*";
if (part_of_multiple)
- uiout->field_string ("enabled", (loc->disabled_by_cond ? N
- : (loc->enabled ? "y" : "n")));
+ {
+ /* For locations that are disabled because of an invalid
+ condition, display "N*" on the CLI, where "*" refers to a
+ footnote below the table. For MI, simply display a "N"
+ without a footnote. On the CLI, for enabled locations whose
+ breakpoint is disabled, display "y-". */
+ auto get_enable_state = [uiout, loc] () -> const char *
+ {
+ if (uiout->is_mi_like_p ())
+ {
+ if (loc->disabled_by_cond)
+ return "N";
+ else if (!loc->enabled)
+ return "n";
+ else
+ return "y";
+ }
+ else
+ {
+ if (loc->disabled_by_cond)
+ return "N*";
+ else if (!loc->enabled)
+ return "n";
+ else if (!breakpoint_enabled (loc->owner))
+ return "y-";
+ else
+ return "y";
+ }
+ };
+ uiout->field_string ("enabled", get_enable_state ());
+ }
else
uiout->field_fmt ("enabled", "%c", bpenables[(int) b->enable_state]);