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]

Re: [patch] GDB 7.2: new feature for "backtrace" that cuts path to file (remain filename)


> 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.


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