From: Jie Zhang <jie@codesourcery.com>
To: tromey@redhat.com
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC] Fix a bug in source file searching
Date: Wed, 31 Mar 2010 06:09:00 -0000 [thread overview]
Message-ID: <4BB2E6F7.4020401@codesourcery.com> (raw)
In-Reply-To: <m3k4stsbi5.fsf@fleche.redhat.com>
On 03/31/2010 06:14 AM, Tom Tromey wrote:
>>>>>> "Jie" == Jie Zhang<jie@codesourcery.com> writes:
>
> Jie> I found this bug when debugging GCC. (Actually I don't know if this is
> Jie> a bug in GDB code or documentation.) I prepared a patch so you can
> Jie> easily comment.
>
> Thanks.
>
> Jie> And .gdbinit file in GCC build directory has
> Jie> dir ../../../svn/trunk/gcc/fortran
> Jie> So it looked GDB searched pathes added by dir command first.
>
> Jie> But the GDB documentation says in "9.5 Specifying Source Directories":
> Jie> [quote]
> Jie> For example, suppose an executable references the file
> Jie> /usr/src/foo-1.0/lib/foo.c, and our source path is /mnt/cross. The
> Jie> file is first looked up literally; if this fails,
> Jie> /mnt/cross/usr/src/foo-1.0/lib/foo.c is tried; if this fails,
> Jie> /mnt/cross/foo.c is opened; if this fails, an error message is
> Jie> printed.
> Jie> [/quote]
>
> Maybe the documentation is just wrong or misleading here. I say that
> because the special entry `$cdir' expands to the compilation directory,
> and you can control where this appears pretty easily.
>
Maybe I misunderstood the document. I thought
comp_dir = /usr/src/foo-1.0
filename = lib/foo.c
should be same as
comp_dir =
filename = /usr/src/foo-1.0/lib/foo.c
Obviously GDB treats them differently although I don't know why.
And I don't know why GCC adds those dir commands in its .gdbinit. I will
ask on GCC mailing list.
--
Jie Zhang
CodeSourcery
(650) 331-3385 x735
next prev parent reply other threads:[~2010-03-31 6:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-29 3:22 Jie Zhang
2010-03-30 22:14 ` Tom Tromey
2010-03-31 6:09 ` Jie Zhang [this message]
2010-04-07 20:53 ` Tom Tromey
2010-04-08 0:49 ` Jie Zhang
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=4BB2E6F7.4020401@codesourcery.com \
--to=jie@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.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