From: Eli Zaretskii <eliz@gnu.org>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: mgulick@mathworks.com, gdb-patches@sourceware.org
Subject: Re: [RFC] Apply compilation dir to source_path lookup
Date: Fri, 13 Sep 2019 06:36:00 -0000 [thread overview]
Message-ID: <835zlw1z45.fsf@gnu.org> (raw)
In-Reply-To: <20190913013851.GT6076@embecosm.com> (message from Andrew Burgess on Thu, 12 Sep 2019 21:38:51 -0400)
> Date: Thu, 12 Sep 2019 21:38:51 -0400
> From: Andrew Burgess <andrew.burgess@embecosm.com>
> Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
> Eli Zaretskii <eliz@gnu.org>
>
> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
> index 79824a0226a..b6b87b28b9f 100644
> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo
> @@ -8968,9 +8968,23 @@
> Plain file names, relative file names with leading directories, file
> names containing dots, etc.@: are all treated as described above; for
> instance, if the source path is @file{/mnt/cross}, and the source file
> -is recorded as @file{../lib/foo.c}, @value{GDBN} would first try
> -@file{../lib/foo.c}, then @file{/mnt/cross/../lib/foo.c}, and after
> -that---@file{/mnt/cross/foo.c}.
> +is recorded as @file{../lib/foo.c} and no compilation directory is
> +recorded, @value{GDBN} would first try @file{../lib/foo.c}, then
> +@file{/mnt/cross/../lib/foo.c}, and after that
> +@file{/mnt/cross/foo.c}.
> +
> +When there is both a filename and a compilation directory in the debug
> +information, and if @value{GDBN} hasn't found the source file using
> +the above approach, then @value{GDBN} will append the filename to the
> +compilation directory and retry using the above steps; for instance,
> +if the source path is @file{/mnt/cross}, and the source file is
> +recorded as @file{../lib/foo.c} and the compilation directory is
> +recorded as @file{/usr/src/foo-1.0/build}, @value{GDBN} would first
> +try @file{../lib/foo.c}, then @file{/mnt/cross/../lib/foo.c}, then
> +@file{/mnt/cross/foo.c}, using the approach outlined above. If the
> +source file still hasn't been found then @value{GDBN} will next check
> +@file{/usr/src/foo-1.0/build/../lib/foo.c}, then
> +@file{/mnt/cross/usr/src/foo-1.0/build/../lib/foo.c}.
This text is unnecessarily long and complicated. How about this
shortened version -- does it correctly convey the intent?
Plain file names, relative file names with leading directories, file
names containing dots, etc.@: are all treated as described above; for
instance, if the source path is @file{/mnt/cross}, and the source file
is recorded as @file{../lib/foo.c}, @value{GDBN} would first try
@file{../lib/foo.c}, then @file{/mnt/cross/../lib/foo.c}, and after
that---@file{/mnt/cross/foo.c}.
If the above search fails to find the source file @file{foo.c}, and
the compilation directory is recorded in the debug information,
@value{GDBN} will repeat the search using the compilation directory
as if it were in the source path.
> @value{GDBN} will also append the compilation
> +directory to the filename and check this against all other entries in
> +the source path.
I think "append" here is a mistake. Should it be "prepend"? And
anyway, doesn't this simply repeat what was described in the text
above?
Thanks.
next prev parent reply other threads:[~2019-09-13 6:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 22:40 Mike Gulick
2019-09-07 23:51 ` Andrew Burgess
2019-09-09 22:41 ` Mike Gulick
2019-09-13 1:38 ` Andrew Burgess
2019-09-13 6:36 ` Eli Zaretskii [this message]
2019-09-13 7:28 ` Eli Zaretskii
2019-09-13 22:45 ` Andrew Burgess
2019-09-13 22:52 ` Mike Gulick
2019-09-14 7:11 ` Eli Zaretskii
2019-09-17 20:22 ` Andrew Burgess
2019-09-17 20:39 ` Mike Gulick
2019-09-14 6:56 ` Eli Zaretskii
2019-09-14 15:28 ` Andrew Burgess
2019-09-14 15:54 ` Eli Zaretskii
2019-09-15 2:07 ` Mike Gulick
2019-09-15 4:01 ` Andrew Burgess
2019-09-15 15:29 ` Eli Zaretskii
2019-09-16 15:53 ` Mike Gulick
2019-09-13 22:11 ` Mike Gulick
2019-09-13 22:41 ` Andrew Burgess
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=835zlw1z45.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@sourceware.org \
--cc=mgulick@mathworks.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox