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: Search debugfile directly in debug-file-directory if specified


Hello,

> Hi, When I set debug-file-directory, searching for debuglink doesn't
> work when it is located directly in that directory
> (<debug-file-directory>/debuglink). This patch fixes this issue.

> ChangeLog:
> 2014-04-09  Mateusz Tabaka  <8tab@wp.pl>
> 
>         * symfile.c: search debugfile directly in
> debug-file-directory if specified

Thanks for the patch.

I am not a specialist of this area, but it seems to me that, after
reading the GDB documentation at:
https://www.sourceware.org/gdb/current/onlinedocs/gdb/Separate-Debug-Files.html

... that the current behavior is as documented. See the example
the documentation provides about the various alternatives that
GDB searches for. Sometimes, a case can be made for extending
a bit the behavior to accomodate other situations, but I am having
trouble seeing the benefits in your case. Why not put the debuglink
file in <debug-file-directory>/.debug/<debuglink>?

A couple of comments, while looking at your patch:

  - The ChangeLog entry needs to be adjusted a bit to provide the name
    of the subprogram where the change was made.  Lines should try
    to be within 70 chars, with a maximum length of 80 chars, and
    should all be indented by a tab.

  - Comments should be sentences starting with a capital letter,
    and ending with a period (you forgot the period).

Thank you.

> 
> 
> diff --git a/gdb/symfile.c b/gdb/symfile.c
> index 64a83c6..559ca95 100644
> --- a/gdb/symfile.c
> +++ b/gdb/symfile.c
> @@ -1534,6 +1534,17 @@ find_separate_debug_file (const char *dir,
>               return debugfile;
>             }
>         }
> +      /* If debugfile doesn't exists in all of above paths,
> +         try "<debug-file-directory>/<debuglink>" */
> +      strcpy (debugfile, debugdir);
> +      strcat (debugfile, "/");
> +      strcat (debugfile, debuglink);
> +
> +      if (separate_debug_file_exists (debugfile, crc32, objfile))
> +       {
> +         do_cleanups (back_to);
> +         return debugfile;
> +       }
>      }
> 
>    do_cleanups (back_to);

-- 
Joel


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