]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Don't print parenthesis if there are no capability attributes
authorLuis Machado <luis.machado@linaro.org>
Wed, 6 Jan 2021 12:30:27 +0000 (09:30 -0300)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 1 Sep 2022 22:53:23 +0000 (15:53 -0700)
gdbsupport/ChangeLog:

2021-01-15  Luis Machado  <luis.machado@arm.com>

capability.cc (capability::to_str): Don't print parenthesis if there
are no attributes.

gdbsupport/capability.cc

index eb8f6980f781abdaa413938512780c91bb796a19..e75b8f6de7b2e03f79fe17a6dde55e599e501667 100644 (file)
@@ -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;
     }