From 4d27c73d60c50420298683e2bd035d0ec59bb7ed Mon Sep 17 00:00:00 2001 From: Luis Machado Date: Wed, 6 Jan 2021 09:30:27 -0300 Subject: [PATCH] Don't print parenthesis if there are no capability attributes gdbsupport/ChangeLog: 2021-01-15 Luis Machado capability.cc (capability::to_str): Don't print parenthesis if there are no attributes. --- gdbsupport/capability.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gdbsupport/capability.cc b/gdbsupport/capability.cc index eb8f6980f78..e75b8f6de7b 100644 --- a/gdbsupport/capability.cc +++ b/gdbsupport/capability.cc @@ -612,7 +612,9 @@ capability::to_str (bool compact) } cap_str += val_str + " [" + perm_str + "," + range_str + "]"; - cap_str += " (" + attr1_str + attr2_str + attr3_str + ")"; + + if (!attr1_str.empty () || !attr2_str.empty () || !attr3_str.empty ()) + cap_str += " (" + attr1_str + attr2_str + attr3_str + ")"; return cap_str; } -- 2.47.2