Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Doug Evans" <dje@google.com>
To: "Joel Brobecker" <brobecker@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [rfc] Use substitute-path for filename portion too
Date: Fri, 08 Feb 2008 00:31:00 -0000	[thread overview]
Message-ID: <e394668d0802071630m5234adf4xa3b5adae7428fb04@mail.gmail.com> (raw)
In-Reply-To: <20080207181346.GA21484@caradoc.them.org>

On Feb 7, 2008 10:13 AM, Daniel Jacobowitz <drow@false.org> wrote:
> On Thu, Feb 07, 2008 at 09:56:58AM -0800, Joel Brobecker wrote:
> > > +
> > > +  if (IS_ABSOLUTE_PATH (filename))
> > >      {
> > > -      /* If dirname is NULL, chances are the path is embedded in
> > > -         the filename.  Try the source path substitution on it.  */
> > > +      /* If filename is absolute path, try the source path
> > > +    substitution on it.  */
> >
> > Do we want to restrict this to filenames that are absolute paths?
> > Imagine the filename was codesourcery/bar/bar.h and the rewrite was
> > s/codesourcery/adacore/, do we want to attempt the rewrite then?
> > I suppose we should wait to see a real example of such a situation
> > before trying to support it...
>
> Are such rules supported?  I couldn't work out from the manual
> what FROM and TO had to be.

There is one related issue that I'd like to get fixed.  If there are
two files foo.c, and I want to set a breakpoint in one of them, there
is currently no robust way to do that.  If DW_AT_name includes _some_
directory information then it can work, i.e. I can say break
bar/foo.c:3 and it will only find bar/foo.c even if there is
baz/foo.c.  But this only works if DW_AT_name contains the requisite
directory instead of DW_AT_comp_dir containing the entire directory.
This can be achieved by specifying the path to gcc, e.g. gcc -c -g
bar/foo.c -o bar/foo.o instead of (cd bar && gcc -c -g foo.c).

I think what should happen is that if I say "break bar/foo.c:3" then
gdb should do the appropriate searching even if DW_AT_name is only
"foo.c".  If there is a collision gdb should probably either give an
error or give the user a choice - I can't imagine the user wanting to
choose "all" but I suppose that could be an option.

In conjunction with that I'd like to have emacs' "C-x space" set the
breakpoint in the correct file, but I'm not sure how much work that
would involve.  [This would extend to other frontends too.]


  parent reply	other threads:[~2008-02-08  0:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 17:47 Daniel Jacobowitz
2008-02-07 17:57 ` Joel Brobecker
2008-02-07 18:14   ` Daniel Jacobowitz
2008-02-07 18:28     ` Joel Brobecker
2008-02-07 18:51       ` Aleksandar Ristovski
2008-02-08 15:02       ` Eli Zaretskii
2008-02-08  0:31     ` Doug Evans [this message]
2008-02-08 22:20       ` Daniel Jacobowitz
2008-02-08 22:21 ` 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=e394668d0802071630m5234adf4xa3b5adae7428fb04@mail.gmail.com \
    --to=dje@google.com \
    --cc=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