From 85c88e2a79973660719be21dbec920fe32f285c1 Mon Sep 17 00:00:00 2001 From: Tankut Baris Aktemur Date: Wed, 21 Apr 2021 16:42:39 +0200 Subject: gdb/breakpoint: display "N" on MI for disabled-by-condition locations For breakpoint locations that are disabled because of an invalid condition, CLI displays "N*" in the 'enabled' field, where '*' refers to the footnote below the table: (*): Breakpoint condition is invalid at this location. This is not necessary for MI, where we shall simply print "N" without the footnote. Update the document to mention the "N" value for the MI. Also remove the line about the 'enable' field, because there is no such field for locations. gdb/ChangeLog: 2021-04-21 Tankut Baris Aktemur * breakpoint.c (print_one_breakpoint_location): Display "N" for disabled-by-condition locations on MI-like output. (breakpoint_1): Do not display the disabled-by-condition footnote if the output is MI-like. gdb/doc/ChangeLog: 2021-04-21 Tankut Baris Aktemur * gdb.texinfo (GDB/MI Breakpoint Information): Update the description for the 'enabled' field of breakpoint locations. --- gdb/ChangeLog | 7 +++++++ gdb/breakpoint.c | 8 ++++++-- gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 13 ++++++++++--- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 13d0bc2..a900a1d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2021-04-21 Tankut Baris Aktemur + + * breakpoint.c (print_one_breakpoint_location): Display "N" for + disabled-by-condition locations on MI-like output. + (breakpoint_1): Do not display the disabled-by-condition footnote + if the output is MI-like. + 2021-04-21 Frederic Cambus * syscalls/update-netbsd.sh: Fix script name display in usage, and diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 16cf797..0136019 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -6190,8 +6190,12 @@ 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*" + uiout->field_string ("enabled", (loc->disabled_by_cond ? N : (loc->enabled ? "y" : "n"))); else uiout->field_fmt ("enabled", "%c", bpenables[(int) b->enable_state]); @@ -6716,7 +6720,7 @@ breakpoint_1 (const char *bp_num_list, bool show_internal, if (last_loc && !server_command) set_next_address (last_loc->gdbarch, last_loc->address); - if (has_disabled_by_cond_location) + if (has_disabled_by_cond_location && !uiout->is_mi_like_p ()) uiout->message (_("(*): Breakpoint condition is invalid at this " "location.\n")); } diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 32801bf..08e3182 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2021-04-21 Tankut Baris Aktemur + + * gdb.texinfo (GDB/MI Breakpoint Information): Update the + description for the 'enabled' field of breakpoint locations. + 2021-04-15 Tom Tromey Andrew Burgess diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index d13cbda..fd04aee 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -30154,9 +30154,16 @@ number of the parent breakpoint. The second digit is the number of the location within that breakpoint. @item enabled -This indicates whether the location is enabled, in which case the -value is @samp{y}, or disabled, in which case the value is @samp{n}. -Note that this is not the same as the field @code{enable}. +There are three possible values, with the following meanings: +@table @code +@item y +The location is enabled. +@item n +The location is disabled by the user. +@item N +The location is disabled because the breakpoint condition is invalid +at this location. +@end table @item addr The address of this location as an hexidecimal number. -- cgit v1.1