This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch+doc 2/2] filename-display: default *-sepdebug to absolute


Hi,

this mail obsoletes:
	[patchv2 13/11] Make relative-with-system-absolute the default
	http://sourceware.org/ml/gdb-patches/2013-01/msg00701.html
	Message-ID: <20130129221118.GB27463@host2.jankratochvil.net>


Thanks,
Jan


gdb/
2013-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* NEWS (set filename-display): Describe the new default.
	* source.c (filename_display_executable_sepdebug_string)
	(filename_display_libraries_sepdebug_string): Change the initializer.
	(_initialize_source): Remove the last line from filename_display_doc.
	Add doc initialization around executable, libraries,
	executable-with-separate-debug-info and
	libraries-with-separate-debug-info with a default statement.

gdb/doc/
2013-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.texinfo (Backtrace): Remove the default statement from set
	filename-display relative.  Add four default statements at each of the
	set filename-display specific setters.

gdb/testsuite/
2013-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.threads/linux-dp.exp (first thread-specific breakpoint hit):
	Allow displayed path for pthread_create.c.

--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -135,8 +135,10 @@ show filename-display libraries
 show filename-display executable-with-separate-debug-info
 show filename-display libraries-with-separate-debug-info
   Control the way in which filenames is displayed.
-  The default is "relative" for all the options, which preserves previous
-  behavior.
+  Previous behavior was "relative" for all the options.
+  New default is changed for the options "executable-with-separate-debug-info"
+  and "libraries-with-separate-debug-info" to "absolute".  This prints source
+  filenames from files with separate debug info in absolute form.
 
 * MI changes
 
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -6545,7 +6545,7 @@ same value for all the four kinds of inferior files as described below.
 
 @item set filename-display relative
 @cindex filename-display
-Display file names relative to the compilation directory.  This is the default.
+Display file names relative to the compilation directory.
 
 @item set filename-display basename
 Display only basename of a filename.
@@ -6571,6 +6571,8 @@ Set how to display filenames coming from the inferior executable, as set by the
 @ref{file command}.  Inferior executable has to use embedded debug info as is
 usually found in binaries compiled by @value{GDBN} user.
 
+The default for inferior executable with embedded debug info is relative.
+
 @item show filename-display executable
 Show the current way to display filenames coming from the inferior executable
 with embedded debug info.
@@ -6580,6 +6582,8 @@ Set how to display filenames coming from inferior shared libraries.  The shared
 libraries have to use embedded debug info as is usually found in shared
 libraries compiled by @value{GDBN} user.
 
+The default for inferior shared libraries with embedded debug info is relative.
+
 @item show filename-display libraries
 Show the current way to display filenames coming from the inferior shared
 libraries with embedded debug info.
@@ -6589,6 +6593,8 @@ Set how to display filenames coming from the inferior executable, as set by the
 @ref{file command}.  Inferior executable has to use separate debug info file as
 is usually optionally provided by operating system debug info packages.
 
+The default for inferior executable with separate debug info file is absolute.
+
 @item show filename-display executable-with-separate-debug-info
 Show the current way to display filenames coming from the inferior executable
 with separate debug info file.
@@ -6598,6 +6604,9 @@ Set how to display filenames coming from inferior shared libraries.  The shared
 libraries have to use separate debug info files as are usually found in shared
 libraries optionally provided by operating system debug info packages.
 
+The default for inferior shared libraries with separate debug info file is
+absolute.
+
 @item show filename-display libraries-with-separate-debug-info
 Show the current way to display filenames coming from the inferior shared
 libraries with separate debug info file.
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -133,11 +133,11 @@ static const char *filename_display_libraries_string =
 
 /* Setting for "set filename-display executable-with-separate-debug-info".  */
 static const char *filename_display_executable_sepdebug_string =
-  filename_display_relative;
+  filename_display_absolute;
 
 /* Setting for "set filename-display libraries-with-separate-debug-info".  */
 static const char *filename_display_libraries_sepdebug_string =
-  filename_display_relative;
+  filename_display_absolute;
 
 /* Implement command "show filename-display executable".  */
 
@@ -2221,8 +2221,7 @@ is not specified, print all substitution rules."),
 filename-display can be:\n\
   basename - display only basename of a filename\n\
   relative - display a filename relative to the compilation directory\n\
-  absolute - display an absolute filename\n\
-By default, relative filenames are displayed."),
+  absolute - display an absolute filename");
 
   doc = xstrprintf (_("\
 Set how to display filenames for all categories of files.\n\
@@ -2242,45 +2241,53 @@ Show how to display filenames for all categories of files.\n\
 		  0/*allow-unknown*/, &showlist);
   xfree (doc);
 
+  doc = xstrprintf (_("\
+%s\n\
+By default, relative filenames are displayed."),
+		    filename_display_doc);
   add_setshow_enum_cmd ("executable", class_files,
 			filename_display_kind_names,
 			&filename_display_executable_string, _("\
 Set how to display filenames in executable with embedded debug info."), _("\
 Show how to display filenames in executable with embedded debug info."),
-			filename_display_doc, NULL,
+			doc, NULL,
 			show_filename_display_executable_string,
 			&filename_display_set_cmdlist,
 			&filename_display_show_cmdlist);
-
   add_setshow_enum_cmd ("libraries", class_files,
 			filename_display_kind_names,
 			&filename_display_libraries_string, _("\
 Set how to display filenames in libraries with embedded debug info."), _("\
 Show how to display filenames in libraries with embedded debug info."),
-			filename_display_doc, NULL,
+			doc, NULL,
 			show_filename_display_libraries_string,
 			&filename_display_set_cmdlist,
 			&filename_display_show_cmdlist);
+  xfree (doc);
 
+  doc = xstrprintf (_("\
+%s\n\
+By default, absolute filenames are displayed."),
+		    filename_display_doc);
   add_setshow_enum_cmd ("executable-with-separate-debug-info", class_files,
 			filename_display_kind_names,
 			&filename_display_executable_sepdebug_string, _("\
 Set how to display filenames in executable with separate debug info."), _("\
 Show how to display filenames in executable with separate debug info."),
-			filename_display_doc, NULL,
+			doc, NULL,
 			show_filename_display_executable_sepdebug_string,
 			&filename_display_set_cmdlist,
 			&filename_display_show_cmdlist);
-
   add_setshow_enum_cmd ("libraries-with-separate-debug-info", class_files,
 			filename_display_kind_names,
 			&filename_display_libraries_sepdebug_string, _("\
 Set how to display filenames in libraries with separate debug info."), _("\
 Show how to display filenames in libraries with separate debug info."),
-			filename_display_doc, NULL,
+			doc, NULL,
 			show_filename_display_libraries_sepdebug_string,
 			&filename_display_set_cmdlist,
 			&filename_display_show_cmdlist);
+  xfree (doc);
 
   add_cmd ("basename", class_files, set_filename_display_basename_string,
            _("\
--- a/gdb/testsuite/gdb.threads/linux-dp.exp
+++ b/gdb/testsuite/gdb.threads/linux-dp.exp
@@ -233,7 +233,9 @@ gdb_continue_to_breakpoint "thread 5's print"
 # If you do have debug info, the output obviously depends more on the
 # exact library in use; under NPTL, you get:
 #    #2  0x0012b7fc in start_thread (arg=0x21) at pthread_create.c:264
-gdb_test "where" "print_philosopher.*philosopher.* \(from .*libpthread\|at pthread_create\|in pthread_create\).*" \
+# and with "set filename-display absolute" one gets:
+#    #2  0x0012b7fc in start_thread (arg=0x21) at /path/to/pthread_create.c:264
+gdb_test "where" "print_philosopher.*philosopher.* \(from .*libpthread\|at pthread_create\|in \[^\r\n\]*pthread_create\).*" \
 	"first thread-specific breakpoint hit"
 
 # Make sure it's catching the right thread.  Try hitting the


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]