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

>>>>> "Eli" == Eli Zaretskii <eliz@is.elta.co.il> writes:

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

The problem doesn't really occur if every file has a unique name, due
to how the gdb `break' command searches for files.

Eli>    (gdb) break ../mauve/gnu/testlet/java/text/DateFormat/Test.java:85
Eli> and it would have worked, right?

Yes, that would have worked.

Eli> What you, in effect, want is for GUD to support relative file
Eli> names which are not relative to the default directory of the
Eli> buffer from which you set the breakpoint.

Actually, that isn't what I want.  I want it to work without any extra
interaction by me.  One way would be for both gdb and Emacs to agree
that using absolute paths will work.

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

I dislike this solution.  It means more work for me, the user, when
clearly more work isn't required -- Emacs knows the absolute path, and
gdb can (in theory) already find it via the paths specified to `dir'.

For instance, gdb already knows that
`../mauve/gnu/testlet/java/text/DateFormat/Test.java' is a file in my
program.  It gets this information, verbatim, from the debug info.

If I type `break
/blah/blah/mauve/gnu/testlet/java/text/DateFormat/Test.java:57', gdb
could very easily go down the list of directories as set by `dir', and
for each one go through each file in the executable, concatenate and
normalize, and then see if the answer is right.

For instance, if the directory list is `/one:/blah/blah, then gdb could
first try:

    /one/../mauve/gnu/testlet/java/text/DateFormat/Test.java
which normalizes to (I assume no symlinks, but gdb need not -- it
could use realpath):
    /one/mauve/gnu/testlet/java/text/DateFormat/Test.java

If that fails then gdb would try:

    /blah/blah/../mauve/gnu/testlet/java/text/DateFormat/Test.java
which normalizes to:
    /blah/blah/mauve/gnu/testlet/java/text/DateFormat/Test.java
-- the right answer.

This might be expensive, so probably it should only be done if the
argument to `break' is an absolute path.  Or maybe caching would be
appropriate.

One reason I think this is important is that even the worst IDE can
let the user do this without a lot of fuss.  I think it shouldn't be a
problem for Emacs+gdb to handle it too.

Tom


  parent reply	other threads:[~2001-09-10 19:58 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
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 [this message]
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=87wv36mnfy.fsf@creche.redhat.com \
    --to=tromey@redhat.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=eliz@is.elta.co.il \
    --cc=gdb@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