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: Tom Tromey <tromey at redhat dot com>
- To: iam ahal <hal9000ed2k at gmail dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, pedro at codesourcery dot com, dje at google dot com, gdb-patches at sourceware dot org, pmuldoon at redhat dot com, brobecker at adacore dot com, drow at false dot org, jan dot kratochvil at redhat dot com
- Date: Wed, 14 Mar 2012 10:10:21 -0600
- 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> <83fwgzbrp9.fsf@gnu.org> <E1RXQvX-00045Q-Hk@fencepost.gnu.org> <201112061249.47758.pedro@codesourcery.com> <E1RXugC-0005av-VR@fencepost.gnu.org> <m3obvll9hr.fsf@fleche.redhat.com> <E1RYCLT-0000ap-OY@fencepost.gnu.org> <CAA18ub+S+5Tw4D8X=c4=J995Gc7goS_Bm4MfuYqV8BWndoTmrQ@mail.gmail.com>
>>>>> "Iam" == iam ahal <hal9000ed2k@gmail.com> writes:
Iam> First of all, I'm sorry for a late response (again).
No problem :)
Iam> Copyright assignment has been done.
Super.
I have just a few nits.
Iam> +If backtraces isn't easy to read due to a long absolute filename path recorded and
Iam> +you just want to see only a basename or a relative filename path, you can change this
Iam> +behaviour:
These lines are too long.
gdb uses the American English spelling, "behavior".
Eli will have to review the rest of the docs, these just jumped out at
me immediately.
Iam> + else if (filename_display_string == filename_display_relative_directory &&
Iam> + dirname && dlen && dlen <= strlen (filename) &&
Iam> + !filename_ncmp (filename, dirname, dlen))
In the GNU style, lines are broken before operators, not after.
So, the "&&"s should be moved.
Iam> + const char *filename_display = get_filename_display_from_sal (&sal);
Iam> +
Iam> + if (filename_display == NULL)
Iam> + filename_display = sal.symtab->filename;
It seems to me that you can just drop the NULL check.
When can filename_display be NULL, except with sal.symtab->filename is
already NULL?
Tom