From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [patchv3 12/11] New options {relative,basename}-with-system-absolute
Date: Sat, 02 Feb 2013 18:12:00 -0000 [thread overview]
Message-ID: <20130202181219.GB16269@host2.jankratochvil.net> (raw)
In-Reply-To: <8338xiiodg.fsf@gnu.org>
On Wed, 30 Jan 2013 18:15:07 +0100, Eli Zaretskii wrote:
> > +@item set filename-display basename-with-system-absolute
> > +Determine whether a source filename comes from file having separate debug
> > +information file. In such case display the source filename as absolute one.
> > +Otherwise display only basename of the filename.
>
> Similarly here: start with "Display ..." as this what the option
> controls.
used:
debug info, and all the other source file names only as their basenames.
Thanks,
Jan
gdb/
2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (set filename-display): Add options
relative-with-system-absolute and basename-with-system-absolute.
* source.c (filename_display_relative_with_system_absolute)
(filename_display_basename_with_system_absolute): New.
(filename_display_kind_names): Add them.
(symtab_to_filename_for_display): Use them.
(_initialize_source): Describe them for "set filename-display".
gdb/doc/
2013-01-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo (Backtrace): Add new set filename-display options
relative-with-system-absolute and basename-with-system-absolute.
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -115,7 +115,8 @@ show print type typedefs
Control whether typedef definitions are displayed by "ptype".
The default is to show them.
-set filename-display basename|relative|absolute
+set filename-display basename|relative|absolute|relative-with-system-absolute
+ |basename-with-system-absolute
show filename-display
Control the way in which filenames is displayed.
The default is "relative", which preserves previous behavior.
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -6549,6 +6549,18 @@ Display only basename of a filename.
@item set filename-display absolute
Display an absolute filename.
+@item set filename-display relative-with-system-absolute
+Display as absolute those source file names that come from files with separate
+debug info, and all the other source file names as relative to their
+compilation directory.
+
+Files having separate debug information file are expected to come from system
+shared libraries.
+
+@item set filename-display basename-with-system-absolute
+Display as absolute those source file names that come from files with separate
+debug info, and all the other source file names only as their basenames.
+
@item show filename-display
Show the current way to display filenames.
@end table
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -113,11 +113,17 @@ show_lines_to_list (struct ui_file *file, int from_tty,
static const char filename_display_basename[] = "basename";
static const char filename_display_relative[] = "relative";
static const char filename_display_absolute[] = "absolute";
+static const char filename_display_relative_with_system_absolute[] =
+ "relative-with-system-absolute";
+static const char filename_display_basename_with_system_absolute[] =
+ "basename-with-system-absolute";
static const char *const filename_display_kind_names[] = {
filename_display_basename,
filename_display_relative,
filename_display_absolute,
+ filename_display_relative_with_system_absolute,
+ filename_display_basename_with_system_absolute,
NULL
};
@@ -1144,8 +1150,16 @@ symtab_to_filename_for_display (struct symtab *symtab)
return symtab_to_fullname (symtab);
else if (filename_display_string == filename_display_relative)
return symtab->filename;
- else
- internal_error (__FILE__, __LINE__, _("invalid filename_display_string"));
+
+ if (symtab->objfile->separate_debug_objfile != NULL
+ || symtab->objfile->separate_debug_objfile_backlink != NULL)
+ return symtab_to_fullname (symtab);
+
+ if (filename_display_string == filename_display_relative_with_system_absolute)
+ return symtab->filename;
+ if (filename_display_string == filename_display_basename_with_system_absolute)
+ return lbasename (symtab->filename);
+ internal_error (__FILE__, __LINE__, _("invalid filename_display_string"));
}
\f
/* Create and initialize the table S->line_charpos that records
@@ -2071,6 +2085,13 @@ 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\
+ relative-with-system-absolute - display filenames from files with separate\n\
+ debug info files as absolute, other files\n\
+ display relative to the compilation directory\
+\n\
+ basename-with-system-absolute - display filenames from files with separate\n\
+ debug info files as absolute, other files\n\
+ display only with basename of the filename\n\
By default, relative filenames are displayed."),
NULL,
show_filename_display_string,
next prev parent reply other threads:[~2013-02-02 18:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-29 22:10 [patchv2 " Jan Kratochvil
2013-01-30 7:48 ` [patchv3 " Jan Kratochvil
2013-01-30 17:15 ` Eli Zaretskii
2013-01-30 18:30 ` Eli Zaretskii
2013-01-30 18:53 ` Jan Kratochvil
2013-01-30 20:11 ` Eli Zaretskii
2013-01-30 21:48 ` Doug Evans
2013-01-31 3:49 ` Eli Zaretskii
2013-01-31 18:07 ` Doug Evans
2013-01-31 18:54 ` Eli Zaretskii
2013-02-01 3:41 ` Doug Evans
2013-02-01 8:09 ` Eli Zaretskii
2013-02-02 18:12 ` Jan Kratochvil [this message]
2013-02-01 20:59 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130202181219.GB16269@host2.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox