[binutils-gdb] Fix weird quoting in stap-probe.c

Tom Tromey tromey@sourceware.org
Thu Nov 5 20:38:36 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0d40b09f42853a617e619d293601cb1c12065451

commit 0d40b09f42853a617e619d293601cb1c12065451
Author: Tom Tromey <tom@tromey.com>
Date:   Thu Aug 20 11:46:20 2026 -0600

    Fix weird quoting in stap-probe.c
    
    I found some code in stap-probe.c that split the quoting in a strange
    way:
    
                    warning (_("unrecognized bitness %s%c' for probe `%s'"),
                             got_minus ? "`-" : "`", *cur,
    
    Here the leading ` is not part of the format string.  I found this odd
    and so I split this fix out into its own patch.
    
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34044

Diff:
---
 gdb/stap-probe.c                                      | 4 ++--
 gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.exp | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index 986ff38c586..654a2f7ca45 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -1304,8 +1304,8 @@ stap_probe::parse_arguments (struct gdbarch *gdbarch)
 	      {
 		/* We have an error, because we don't expect anything
 		   except 1, 2, 4 and 8.  */
-		warning (_("unrecognized bitness %s%c' for probe `%s'"),
-			 got_minus ? "`-" : "`", *cur,
+		warning (_("unrecognized bitness \"%s%c\" for probe \"%s\""),
+			 got_minus ? "-" : "", *cur,
 			 this->get_name ().c_str ());
 		return;
 	      }
diff --git a/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.exp b/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.exp
index 9cd7dec166c..8f26e3fe9bf 100644
--- a/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.exp
+++ b/gdb/testsuite/gdb.arch/amd64-stap-optional-prefix.exp
@@ -79,7 +79,7 @@ foreach probe_name $normal_probes_names \
 
 with_test_prefix "fail_probe" {
     goto_probe "fail_probe"
-    gdb_test "print \$_probe_arg0" "warning: unrecognized bitness `-7' for probe `fail_probe'\r\nInvalid probe argument 0 -- probe has 0 arguments available"
+    gdb_test "print \$_probe_arg0" "warning: unrecognized bitness \"-7\" for probe \"fail_probe\"\r\nInvalid probe argument 0 -- probe has 0 arguments available"
 }
 
 with_test_prefix "fail2_probe" {


More information about the Gdb-cvs mailing list