Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] Fix source path lookup immediately after substitute-path
Date: Tue, 22 Sep 2009 21:21:00 -0000	[thread overview]
Message-ID: <20090922212042.GE8910@adacore.com> (raw)
In-Reply-To: <20090922190632.GA31949@caradoc.them.org>

Hi Daniel,

> Any thoughts on this patch?  May I include it in 7.0?

My only thought was that last_source_visited is really only useful
to print_source_lines_base, and it's used as a mechanism to prevent
a warning from being printed every time we try to print source lines
for the same file.  So I thought it might be cleaner if that global
was made static to print_source_lines_base.  However, this wouldn't
work as is, as it turns out this is also used as a cache for source
file lookup! I'm guessing this is only a side-effect of the original
intent.

I believe it would be cleaner to adjust the use of that variable
so as to make it static to print_source_lines_base, but this can
be addressed independently of your patch is someone is interested.
In the meantime, I think your patch is progress, and it seems fine
to put it in 7.0 as well.

> 2009-09-22  Daniel Jacobowitz  <dan@codesourcery.com>
> 
> 	gdb/
> 	* source.c (forget_cached_source_info): Clear last_source_visited.
> 	(init_last_source_visited): Delete.
> 	(directory_command): Do not clear last_source_visited.  Call
> 	forget_cached_source_info only if required.
> 	(unset_substitute_path_command, set_substitute_path_command): Call
> 	forget_cached_source_info.
> 	* mi/mi-cmd-env.c (mi_cmd_env_dir): Do not call
> 	init_last_source_visited.
> 	* defs.h (init_last_source_visited): Delete declaration.
-- 
Joel


  reply	other threads:[~2009-09-22 21:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 19:06 Daniel Jacobowitz
2009-09-22 21:21 ` Joel Brobecker [this message]
2009-09-22 21:45   ` Daniel Jacobowitz
2009-09-22 22:03     ` Joel Brobecker
2009-09-22 22:12       ` Daniel Jacobowitz

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=20090922212042.GE8910@adacore.com \
    --to=brobecker@adacore.com \
    --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