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: [rfc] Use substitute-path for filename portion too


On Thu, Feb 07, 2008 at 04:30:30PM -0800, Doug Evans wrote:
> There is one related issue that I'd like to get fixed.  If there are
> two files foo.c, and I want to set a breakpoint in one of them, there
> is currently no robust way to do that.  If DW_AT_name includes _some_
> directory information then it can work, i.e. I can say break
> bar/foo.c:3 and it will only find bar/foo.c even if there is
> baz/foo.c.  But this only works if DW_AT_name contains the requisite
> directory instead of DW_AT_comp_dir containing the entire directory.
> This can be achieved by specifying the path to gcc, e.g. gcc -c -g
> bar/foo.c -o bar/foo.o instead of (cd bar && gcc -c -g foo.c).
> 
> I think what should happen is that if I say "break bar/foo.c:3" then
> gdb should do the appropriate searching even if DW_AT_name is only
> "foo.c".  If there is a collision gdb should probably either give an
> error or give the user a choice - I can't imagine the user wanting to
> choose "all" but I suppose that could be an option.

I definitely agree that we need to improve handling of this case
(though I'm not sure it's related).

-- 
Daniel Jacobowitz
CodeSourcery


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