]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add text to gdbreplay --help output
authorTom Tromey <tromey@adacore.com>
Mon, 9 Dec 2024 19:22:16 +0000 (12:22 -0700)
committerTom Tromey <tromey@adacore.com>
Thu, 12 Dec 2024 14:37:57 +0000 (07:37 -0700)
I noticed that gdbreplay --help is rather sparse -- it doesn't even
mention the names of the options it accepts.

This patch updates the help output to be more complete.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdbserver/gdbreplay.cc

index 951f50ea54ee502b3801eff800830b9a34339d4c..5c7821aa3a695426c4e66e7c7b312c8c365ece5b 100644 (file)
@@ -474,8 +474,29 @@ static void
 gdbreplay_usage (FILE *stream)
 {
   fprintf (stream, "Usage:\tgdbreplay LOGFILE HOST:PORT\n");
-  if (REPORT_BUGS_TO[0] && stream == stdout)
-    fprintf (stream, "Report bugs to \"%s\".\n", REPORT_BUGS_TO);
+}
+
+static void
+gdbreplay_help ()
+{
+  gdbreplay_usage (stdout);
+
+  printf ("\n");
+  printf ("LOGFILE is a file generated by 'set remotelogfile' in gdb.\n");
+  printf ("COMM may either be a tty device (for serial debugging),\n");
+  printf ("HOST:PORT to listen for a TCP connection, or '-' or 'stdio' to use\n");
+  printf ("stdin/stdout of gdbserver.\n");
+  printf ("\n");
+
+  printf ("Options:\n\n");
+  printf ("  --debug-logging       Show packets as they are processed.\n");
+  printf ("  --help                Print this message and then exit.\n");
+  printf ("  --version             Display version information and then exit.\n");
+  if (REPORT_BUGS_TO[0])
+    {
+      printf ("\n");
+      printf ("Report bugs to \"%s\".\n", REPORT_BUGS_TO);
+    }
 }
 
 /* Main function.  This is called by the real "main" function,
@@ -503,11 +524,16 @@ captured_main (int argc, char *argv[])
          gdbreplay_version ();
          exit (0);
        case OPT_HELP:
-         gdbreplay_usage (stdout);
+         gdbreplay_help ();
          exit (0);
        case OPT_LOGGING:
          debug_logging = true;
          break;
+
+       case '?':
+         fprintf (stderr,
+                  "Use 'gdbreplay --help' for a complete list of options.\n");
+         exit (1);
        }
     }