This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Re: [patch]change dwarf2_start_subfile() to adapt inappropriate dir name
- From: JuYoung Kim <j0 dot kim at samsung dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Mon, 15 Nov 2010 06:25:05 +0000 (GMT)
- Subject: Re: Re: [patch]change dwarf2_start_subfile() to adapt inappropriate dir name
- Msgkey: 20101115061324709@j0.kim
- Reply-to: j0 dot kim at samsung dot com
Thanks for your kind comment.
I changed the source code as below :
........
if (!IS_ABSOLUTE_PATH (filename) && dirname != NULL)
{
if (IS_DIR_SEPARATOR(dirname[strlen (dirname) - 1]))
fullname = concat (dirname, filename, (char *)NULL);
else
fullname = concat (dirname, SLASH_STRING, filename, (char *)NULL);
}
else
fullname = filename;
..........
I hope this code is proper to the standard, and no more to be fixed.
Please, tell me what is the next step that I should do for applying to the real source code.
Thanks.
------- Original Message -------
Sender : Eli Zaretskii<eliz@gnu.org>
Date : 2010-11-15 13:08 (GMT+09:00)
Title : Re: [patch]change dwarf2_start_subfile() to adapt inappropriate dir name
Â
> Date: Mon, 15 Nov 2010 01:21:14 +0000 (GMT)
> From: JuYoung Kim
> Cc: êìì
>
> ÂÂif (!IS_ABSOLUTE_PATH (filename) && dirname != NULL) {
> ÂÂ Â if (dirname[strlen(dirname)-1] == '/' || dirname[strlen(dirname)-1] == '')
Please use IS_DIR_SEPARATOR instead of testing for '/' literally.ÂÂAnd
the second part of the if clause cannot happen at all, so it should be
removed.
Also, the GNU coding standards say to put the braces like this:
ÂÂ if (something)
ÂÂÂÂ{
ÂÂÂÂÂÂdo_something;
ÂÂÂÂÂÂdo_something_else;
ÂÂÂÂ}
> ÂÂ Â else fullname = concat (dirname, SLASH_STRING, filename, (char *)NULL);
Make "else" have its own line, like this:
ÂÂ else
ÂÂÂÂ fullname = concat (dirname, SLASH_STRING, filename, NULL);