This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] GDB 7.2: new feature for "backtrace" that cuts path to file (remain filename)
- From: Eli Zaretskii <eliz at gnu dot org>
- To: iam ahal <hal9000ed2k at gmail dot com>
- Cc: pmuldoon at redhat dot com, tromey at redhat dot com, brobecker at adacore dot com, gdb-patches at sourceware dot org
- Date: Sun, 03 Jul 2011 21:12:30 +0300
- Subject: Re: [patch] GDB 7.2: new feature for "backtrace" that cuts path to file (remain filename)
- References: <BANLkTinD+9_Mkug8o2VhZ03L6XSriL_RKQ@mail.gmail.com> <m3oc1kfheh.fsf@redhat.com> <20110627160029.GF20676@adacore.com> <m3sjqt67pe.fsf@fleche.redhat.com> <m3mxh1oa8a.fsf@redhat.com> <CAA18ubJ10sh3pPDLp4V44qY6r6hLU9RqyDi62KuAAtfXJY7Oug@mail.gmail.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sun, 3 Jul 2011 20:34:55 +0400
> From: iam ahal <hal9000ed2k@gmail.com>
> Cc: Tom Tromey <tromey@redhat.com>, Joel Brobecker <brobecker@adacore.com>, gdb-patches@sourceware.org
>
> +@item backtrace nopath
> +@itemx bt nopath
> +It's similar to @code{backtrace}, but print without full path to file.
I would remove the "It's" part, it's redundant and not very
English-like.
But a larger concern is that GNU coding standards frown on using
"path" when you really mean "file name". So I think we should rename
the option "basename" and the documentation should say
Same as @code{backtrace}, but print only the basename of the file.
> + if (print_what == LOC_NO_FULLPATH)
> + {
> + filename = strrchr (sal.symtab->filename, '/');
This is non-portable (directory separator is not guaranteed to be
'/'), you need to use lbasename instead.