This is the mail archive of the gdb-patches@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: Patch: search `directory' path for `break' files


Tom Tromey wrote:
> 
> >>>>> "Eli" == Eli Zaretskii <eliz@is.elta.co.il> writes:
> 
> >> With this patch, if the file name argument to lookup_symtab is a full
> >> path, we run it through realpath.  Then we search for each symtab's
> >> file using the `dir' list.  If we find a match, we use it.
> 
> Eli> IIRC, last time this was discussed, Per Bothner suggested to use the
> Eli> current directory recorded in the debug info to convert a relative or
> Eli> semi-relative file name into an absolute one.
> 
> Thanks for reminding me of this.  I had misunderstood Per's messages.
> After seeing your message I went back and did some more investigation.
> 
> I think my patch is still a reasonable approach.
> 
> With my patch, we actually do use the directory information, when
> available.  This info is stored in symtab->dirname, and is used when
> trying to find the real path for a symtab.  This happens indirectly
> via symtab_to_filename() (for symtabs).
> 
> So if that information is available, we use it.  But if it isn't, we
> search the user's `directory' path.  This seems like a reasonable
> approach to me.  Also, psymtabs don't have this directory information,
> so in that case we can't use this approach.  We must do the path
> searching.  Perhaps this is fixable; I don't know enough about
> psymtabs to say.
> 
> Eli> I think this needs to be tested with as many debug infor formats
> Eli> as possible.  What format did you use? DWARF2?
> 
> I used stabs.  That is the default for the compiler and system I am
> using.  I will try DWARF2.  Is it easy to run the test suite with
> `-gdwarf2' (or whatever)?

Yes, if you know how.  ;-)
Add this line to dejagnu/config/unix.exp:
	set board_info debug_flags "-gdwarf-2"
(assuming you're testing on unix or linux, otherwise find appropriate file)

Michael


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