Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Earl Chew <earl_chew@agilent.com>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com, cgf@redhat.com
Subject: Re: [RFC PATCH] Finding files in source trees (was Re: Finding source  files under Cygwin)
Date: Mon, 16 Sep 2002 15:17:00 -0000	[thread overview]
Message-ID: <3D865872.76E01CC7@agilent.com> (raw)
In-Reply-To: <20020916220207.GA32278@nevyn.them.org>

Daniel Jacobowitz wrote:
> This patch needs a lot more testing before I'd be comfortable with it.
> We went to a fair amount of trouble to support finding the right file
> when multiple files have the same name.
> 
> For instance, given:
>   dir /a:/b
>   filename foo/bar.c
> 
> files /a/bar.c /b/foo/bar.c
> 
> will your patch find /b/foo/bar.c?  I don't think it will.

Hmm... I think it will. The patch doesn't replace any of the
existing code in open_source_file() --- it adds an extra
search option at the end of the function. In pseudo-code:

  a.	return s->fullname if present // Previously resolved name

  b.	if s->dirname available
	    replace $cdir in path

  c.	search for s->filename in path

  d.	if not found, search for lbasename(s->filename) in path

+ e.	if not found, repeatedly lop separators from head
+	    of s->filename and search in path

(My addition is indicated with +)

> For instance, given:
>   dir /a:/b
>   filename foo/bar.c
> 
> files /a/bar.c /b/foo/bar.c
> 
> will your patch find /b/foo/bar.c?  I don't think it will.

In your example, I'm pretty sure foo/bar.c will be found
at step (c).

My patch at step (e) will only triggered as a last resort,
when open_source_file couldn't find the file anywhere else.

Earl


      reply	other threads:[~2002-09-16 22:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-13 17:57 Finding source files under Cygwin Earl Chew
2002-09-13 21:40 ` Finding source files under cygwin Christopher Faylor
2002-09-16 12:07 ` Finding source files under Cygwin Earl Chew
2002-09-16 12:48   ` Finding source files under cygwin Christopher Faylor
2002-09-16 13:14   ` Finding source files under Cygwin Earl Chew
2002-09-16 13:37   ` [RFC PATCH] Finding files in source trees (was Re: Finding source files under Cygwin) Earl Chew
2002-09-16 15:02     ` Daniel Jacobowitz
2002-09-16 15:17       ` Earl Chew [this message]

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=3D865872.76E01CC7@agilent.com \
    --to=earl_chew@agilent.com \
    --cc=cgf@redhat.com \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.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