This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/5] Also look for debug files in gdb_sysroot
- From: Pedro Alves <palves at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>, gdb-patches at sourceware dot org
- Cc: Cédric Buissart <cedric dot buissart at gmail dot com>
- Date: Wed, 01 Jul 2015 14:45:32 +0100
- Subject: Re: [PATCH 5/5] Also look for debug files in gdb_sysroot
- Authentication-results: sourceware.org; auth=none
- References: <1434447768-17328-1-git-send-email-gbenson at redhat dot com> <1434447768-17328-6-git-send-email-gbenson at redhat dot com>
On 06/16/2015 10:42 AM, Gary Benson wrote:
> This commit makes GDB look for separate debug files in gdb_sysroot if
> not found in the currently searched locations. This allows for easier
> analysis of core files from foreign machines using the sysroot option.
> The user creates or mounts a directory containing the necessary
> binaries and debuginfo and then sets GDB's sysroot to that directory
> before starting their debug session.
Looks fine to me, but I think this should be documented in
the manual, and maybe in the online help somewhere as well?
And NEWS too.
Thanks,
Pedro Alves
>
> gdb/ChangeLog:
>
> * gdb/symfile.c (find_separate_debug_file): In debugdir loop,
> also try alternate directory prefixed with gdb_sysroot.
> ---
> gdb/ChangeLog | 6 ++++++
> gdb/symfile.c | 11 +++++++++++
> 2 files changed, 17 insertions(+), 0 deletions(-)
>
> diff --git a/gdb/symfile.c b/gdb/symfile.c
> index 0cc940a..1cd99ea 100644
> --- a/gdb/symfile.c
> +++ b/gdb/symfile.c
> @@ -1613,6 +1613,7 @@ find_separate_debug_file (const char *dir,
>
> if (altdir != NULL)
> {
> + /* Try in the alternate directory directly. */
> debugfile = build_debug_file_name (no_prefix, debugdir,
> altdir, debuglink, NULL);
> if (separate_debug_file_exists (debugfile, crc32, objfile))
> @@ -1621,6 +1622,16 @@ find_separate_debug_file (const char *dir,
> return debugfile;
> }
> xfree (debugfile);
> +
> + /* Try in the alternate directory in gdb_sysroot. */
> + debugfile = build_debug_file_name (gdb_sysroot, debugdir,
> + altdir, debuglink, NULL);
> + if (separate_debug_file_exists (debugfile, crc32, objfile))
> + {
> + do_cleanups (back_to);
> + return debugfile;
> + }
> + xfree (debugfile);