diff options
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 37 |
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]); |