This is the mail archive of the gdb@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: Filename with "./" in breakpoint command


On Mon, Dec 05, 2005 at 08:39:37PM +0200, Eli Zaretskii wrote:
> Thanks.
> 
> Looking at symtab.c:lookup_symtab, I see that we simply don't try to
> look for anything but the exact match when given a relative file name
> such as "./tracepoints.cpp".
> 
> I'm not sure this is a bug; the idea of asking the user to chdir into
> the right directory and then use "./foo" to distinguish between
> several namesake files doesn't sound like a very user-friendly design,
> not really a big improvement over asking them to specify a full
> absolute file name of the source (in which case it does work for you,
> does it?).
> 
> Perhaps we should modify the lookup_symtab to not return immediately
> after finding the first matching tail (near line 174 in symtab.c), but
> instead see if there's more than one match, and if so, ask the user
> which one she wants.  What do you think?

Or, when the existing lookups have failed for a relative pathname,
canonicalize it and treat it like a full path?

I don't think adding more user interaction at this level is a good idea
- it's too far away from the user commands, in GDB's internals.  It's
been back-burnered for lack of time, but I was working on patches to
handle location lookups returning more than one location; e.g. setting
breakpoints at all locations matching tracepoints.cpp:25.

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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