This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Using gdb with emacs


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

Eli> What happens if you do this:
Eli>      (gdb) dir /home/tromey/gnu/egcs/mauve/gnu/testlet/java/text/DateFormat
Eli>      (gdb) break Test.java:83
Eli> Does it work then?

Yes, that will work for this particular case.  But I don't think it
solves the general problem.  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".

Eli> So I think we need at to least consider another possibility: set
Eli> things up so that all your directories are passed to GDB's dir
Eli> command, and then using the basename in the break commands should
Eli> work.

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

One idea would be for Emacs itself to send the `dir' command to gdb
before issuing the breakpoint.  Maybe that would work ok.  Is that
what you are suggesting?  I would classify this as a potential
workaround, but not really a fix.

Eli> Anything else will IMHO be much more complex and, as Per quite
Eli> correctly pointed out, non-portable because different debug info
Eli> formats record file names in different forms; you just looked at one
Eli> particular type of debug info.  Some types of debug info don't even
Eli> record the leading directories.

I'm not particularly concerned with situations where the debug info is
not robust.  I think it is reasonable for gdb to adopt an approach of
making things work very well on robust platforms (for instance,
Linux), and then having the feature degrade gracefully on less capable
platforms.  I disagree with the idea that gdb must support only the
least common denominator.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]