Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks
Date: Sat, 19 Jan 2013 14:09:00 -0000	[thread overview]
Message-ID: <20130119140914.GA7303@host2.jankratochvil.net> (raw)
In-Reply-To: <83d2x1r7iy.fsf@gnu.org>

On Sat, 19 Jan 2013 07:50:13 +0100, Eli Zaretskii wrote:
> > Could you give an example?  Previously it was forbidden/unspecified what
> > happens when you call compare_filenames_for_search
> > with IS_ABSOLUTE_PATH (search_name).
> 
> Any absolute file name would be an example.

Could you state literal SEARCH_NAME, literal FILENAME, what is a result you
expect and what do you you think is the actual result with this patch?

I have double/triple checked this patch and I do not see a bug there.


> > I hope we agree that placing a breakpoint to
> > 	/filename.c:main 
> > should not be successful even if one of the source files is named:
> > 	/path/to//filename.c
> 
> Yes, we do.  But IS_ABSOLUTE_PATH tests more than just whether there's
> a slash at the beginning of "/filename.c".  I'm saying we should test
> explicitly for the slash, not for the file name being absolute.  IOW,
> using IS_ABSOLUTE_PATH here obfuscates the real intent of the code.

I think IS_ABSOLUTE_PATH is there really right, we need to test if the
SEARCH_NAME should match from the beginning of FILENAME or if it can match
only its trailing part.

For example when asking for a breakpoint at:
	c:\filename.c:main
it must not match a debug info filename:
	d:\foo\c:\filename.c
This case would incorrectly match if only 'IS_DIR_SEPARATOR (search_name[0])'
was tested there.

Moreover this patch is a "Code cleanup" and the callers were already using
IS_ABSOLUTE_PATH.  So if IS_ABSOLUTE_PATH is wrong (which IMO so far it is
not) then it is still a new patch / unrelated fix, not the scope of this
patch.


Thanks,
Jan


  reply	other threads:[~2013-01-19 14:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-17 21:59 Jan Kratochvil
2013-01-18  7:32 ` Eli Zaretskii
2013-01-18 18:39   ` Jan Kratochvil
2013-01-18 19:20     ` Eli Zaretskii
2013-01-18 20:16       ` Jan Kratochvil
2013-01-18 20:40         ` Eli Zaretskii
2013-01-18 21:53           ` Jan Kratochvil
2013-01-19  6:50             ` Eli Zaretskii
2013-01-19 14:09               ` Jan Kratochvil [this message]
2013-01-19 15:18                 ` Eli Zaretskii
2013-01-19 15:27                   ` Jan Kratochvil
2013-01-19 16:02                     ` Eli Zaretskii
2013-01-21 17:06                     ` Jan Kratochvil
2013-01-21 18:46                       ` Tom Tromey
2013-01-21 19:43                         ` Jan Kratochvil
2013-01-21 20:48                           ` Tom Tromey
2013-01-18 21:11     ` [patch 2/9] Code cleanup: Drop IS_ABSOLUTE_PATH checks [resent] Jan Kratochvil

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=20130119140914.GA7303@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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