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: Bug in dwarf2out.c:output_file_names()


Richard Henderson <rth@redhat.com> writes:

> I don't think that it is working at all.  Consider
> 
>     #line 1 "longlonglong/a/z.c"
>     int foo() { return 0; }
>     
>     #line 1 "longlonglong/b/z.c"
>     int bar() { return 0; }
> 
> As I understand what this code is attempting to do, we should
> get one directory entry for "longlonglong" and files "a/z.c"
> and "b/z.c".  But we don't.

Right, and this was intended.  The problem is that handling this case
can have the number of prefixes which have to be examined grow by
large amounts.  One will have to look at every prefix.  I can
implement this and in general the compiler runtime will not be
increased but with many files in very different directories the
runtime can grow nonlinear.  It's unlikely but could happen.

Note what happens if you add to your example above the lines

#line 1 "longlonglong/c"
int baz() { return 0; }


This is more probably to happen. Just assume

 /usr/include
 /usr/include/sys
 /usr/include/bits

> Moreover, I think that the existance of idx_offset at all displays
> a fundamental confusion with handling CWD and dir_idx being zero
> based or one based.

Not really.  One could probably rewrite the code to drop the variable
but the code should be fine with Mark's patch.

> Uli, you wrote this code in the first place.  Care to fix it?

I can *extend* the code, or at least propose a patch.

> Failing that, I'd just as soon rip it out.

This shouldn't be necessary in any case since the changed code works
just fine.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

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