This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH] Avoid most open and stat syscalls when setting a breakpoint


>>>>> "Martin" == Martin Runge <Martin.Runge@rohde-schwarz.com> writes:

Martin> I want to present a patch that helps avoiding many unneccessary
Martin> filesystem accesses when setting breakpoints. This leads to a
Martin> remarkable perfomance improvement when sources are on network
Martin> shares.

Martin> I think that most of these checks are not neccessary, e.g. to
Martin> compare if
Martin> /home/me/project/source/main.cpp
Martin> becomes the same file as  <iostream>  when trying all source paths on 
Martin> main.cpp. The patch below leaves the described search loop when the 
Martin> basename from the symtab and the basename from the break command do not 
Martin> match, as they wont match by appliing different paths either.

ISTR seeing this same patch in the past.

I think the problem is that one of the file names might be a symlink.
The two names might refer to the same file even if the basenames differ.
That's what the gdb_realpath logic is for.

So, I think this patch is not correct, or at least, it changes gdb
incompatibly.  I don't know how much this symlink thing matters in
practice.  Maybe there is some other way to solve this problem, but I
haven't looked into it deeply.

Tom


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