]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
In the --help text, print the actual name of the GDB that will by
authorJulian Seward <jseward@acm.org>
Tue, 20 Nov 2007 19:45:03 +0000 (19:45 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 20 Nov 2007 19:45:03 +0000 (19:45 +0000)
default be used.  Fixes #151938.  Unfortunately this makes the help
text non-constant, which could have a bad effect on regtesting; but
GDB is so usually installed in the standard place /usr/bin/gdb that I
don't think that's much of a big deal.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7192

coregrind/m_main.c

index 50f6cbb21803a7661c363709ee08289b1c01fc1a..84d0953313b45982d0e524a56ec7fa8795a4e58f 100644 (file)
@@ -104,6 +104,8 @@ static void print_all_stats ( void )
 
 static void usage_NORETURN ( Bool debug_help )
 {
+   /* 'usage1' contains a %s for the name of the GDB executable, which
+      must be supplied when it is VG_(printf)'d. */
    Char* usage1 = 
 "usage: valgrind [options] prog-and-args\n"
 "\n"
@@ -145,7 +147,7 @@ static void usage_NORETURN ( Bool debug_help )
 "    --suppressions=<filename> suppress errors described in <filename>\n"
 "    --gen-suppressions=no|yes|all    print suppressions for errors? [no]\n"
 "    --db-attach=no|yes        start debugger when errors detected? [no]\n"
-"    --db-command=<command>    command to start debugger [gdb -nw %%f %%p]\n"
+"    --db-command=<command>    command to start debugger [%s -nw %%f %%p]\n"
 "    --input-fd=<number>       file descriptor for input [0=stdin]\n"
 "    --max-stackframe=<number> assume stack switch for SP changes larger\n"
 "                              than <number> bytes [2000000]\n"
@@ -170,9 +172,6 @@ static void usage_NORETURN ( Bool debug_help )
 "    --trace-sched=no|yes      show thread scheduler details? [no]\n"
 "    --wait-for-gdb=yes|no     pause on startup to wait for gdb attach\n"
 "    --sym-offsets=yes|no      show syms in form 'name+offset' ? [no]\n"
-#if 0
-"    --model-pthreads=yes|no   model the pthreads library [no]\n"
-#endif
 "    --command-line-only=no|yes  only use command line options [no]\n"
 "\n"
 "    --vex-iropt-verbosity             0 .. 9 [0]\n"
@@ -214,7 +213,8 @@ static void usage_NORETURN ( Bool debug_help )
    VG_(clo_log_fd) = 1;
    vg_assert( !VG_(logging_to_socket) );
 
-   VG_(printf)(usage1);
+   /* 'usage1' expects one char* argument */
+   VG_(printf)(usage1, GDB_PATH);
    if (VG_(details).name) {
       VG_(printf)("  user options for %s:\n", VG_(details).name);
       if (VG_(needs).command_line_options)