Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Eli Zaretskii" <eliz@is.elta.co.il>
To: tromey@redhat.com
Cc: gdb@sources.redhat.com, bug-gnu-emacs@gnu.org
Subject: Re: Using gdb with emacs
Date: Sat, 08 Sep 2001 00:36:00 -0000	[thread overview]
Message-ID: <7458-Sat08Sep2001103423+0300-eliz@is.elta.co.il> (raw)
In-Reply-To: <87elpid9dt.fsf@creche.redhat.com>

> From: Tom Tromey <tromey@redhat.com>
> Date: 07 Sep 2001 14:38:22 -0600
> 
> In Mauve, all these files are compiled
> (with gcj) into a single executable.  Mauve has 121 directories.  And
> it has 20 files named "Test.java".

Then what I suggested won't work.  (Personally, I think having many
files by the same name is not a good idea, given how GDB works with
file names recorded in the debug info.)

> First, running 121 `dir' commands seems excessive.

Not if you put that on a .gdbinit file which is part of the source
tree: the directories are known in advance.  But that is not the real
issue here, so let's not engage in nitpicking, okay?

> Second, if I run all those `dir' commands, gdb still won't know
> which Test.java I mean.  How could it?

It can't.  I didn't assume you have many files with the same
basename.

> I disagree with the idea that gdb must support only the least common
> denominator.

I didn't suggest that it should.  And GDB is not the problem, I think:
in GDB, you could simply type your original command:

   (gdb) break ../mauve/gnu/testlet/java/text/DateFormat/Test.java:85

and it would have worked, right?

The problem, if I understand it correctly, is with Emacs, specifically
because, unlike GDB, Emacs doesn't have a notion of a single ``current
directory''.  Its equivalent of the cwd changes when you switch to
another buffer.

What you, in effect, want is for GUD to support relative file names
which are not relative to the default directory of the buffer from
which you set the breakpoint.  This invalidates the assumptions on
which Emacs primitives such as expand-file-name and file-relative-name
base their default operation.  So supporting this at least requires
that GUD knows such file names are supported by the inferior GDB, and
that such file names should be used instead of just the basename.  We
need to find a way to communicate this to GUD somehow.  We also need a
way to tell GUD what is the directory which will serve as the starting
point of the relative file names; let's call this a ``project
directory''.

AFAIK, there's no easy way this information can come from GDB itself,
so we should probably burden the user with supplying it.

All this seems to suggest that just changing %f into %d/%f won't do.
I think we need:

  - A command to set the name of the project directory.

  - A modification of the set breakpoint commands whereby it will
    first try to use file names relative to the project directory if
    that directory is set, and if that fails, fall back on the
    basename, like it does today.  This probably calls for a new
    %something specifier, which will trigger this modified behavior,
    since you probably don't want to change the semantics of %f.


  parent reply	other threads:[~2001-09-08  0:36 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-06 18:23 Tom Tromey
2001-09-06 19:56 ` Per Bothner
2001-09-07  1:01 ` Eli Zaretskii
2001-09-07 13:26   ` Tom Tromey
2001-09-07 13:59     ` Tom Tromey
2001-09-08  0:36     ` Eli Zaretskii [this message]
2001-09-09  8:03       ` Richard Stallman
2001-09-09  9:17         ` Eli Zaretskii
2001-09-09 10:04       ` Per Bothner
2001-09-09 10:41         ` Eli Zaretskii
2001-09-09 21:34           ` Per Bothner
2001-09-10 15:50           ` Richard Stallman
2001-09-10 19:58       ` Tom Tromey
2001-09-11  8:16         ` Andrew Cagney
2001-09-11 11:18           ` Eli Zaretskii
2001-09-09  8:03     ` Richard Stallman
2001-09-10 20:01       ` Tom Tromey
2001-09-08  7:27   ` Richard Stallman
2001-09-08 10:22 ` Andrew Cagney
2001-09-08 10:49   ` Fernando Nasser
2001-09-08 12:54     ` Christopher Faylor
2001-09-10  9:04       ` pathmap patch dropped [was: Re: Using gdb with emacs] Jim Blandy

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=7458-Sat08Sep2001103423+0300-eliz@is.elta.co.il \
    --to=eliz@is.elta.co.il \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=gdb@sources.redhat.com \
    --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