On Mon, Jan 3, 2011 at 10:41 PM, nathan binkert <n...@binkert.org> wrote:

> > So far I've found two oddities with a straightforward implementation of
> this
> > approach:
> >
> > (1) It breaks down when the target is a prefix of the source:
> >
> >  [   STRIP] ALPHA_SE/m5.fast.unstripped ->
> >
> > instead of
> >
> >  [   STRIP] ALPHA_SE/m5.fast: .unstripped ->
> >
> > (2) It gives the wrong impression when targets are in a parent directory
> > relative to the source:
> >
> >  [ISA DESC] ALPHA_SE/arch/alpha/isa/main.isa -> decoder.cc, decoder.hh,
> > max_inst_regs.hh, atomic_simple_cpu_exec.cc, inorder_cpu_exec.cc,
> > o3_cpu_exec.cc, timing_simple_cpu_exec.cc
> >
> > instead of
> >
> >  [ISA DESC] ALPHA_SE/arch/alpha: isa/main.isa -> decoder.cc, decoder.hh,
> > max_inst_regs.hh, atomic_simple_cpu_exec.cc, inorder_cpu_exec.cc,
> > o3_cpu_exec.cc, timing_simple_cpu_exec.cc
> >
> > I don't see these as deal-breakers, and I'm fine with leaving them as
> they
> > are unless someone has a reasonable idea about how to address them, but I
> > thought I'd point out that the ambiguities aren't purely theoretical.
>
> hmmm....  I guess I still like the ability to cut and paste, but the
> ambiguity is annoying (and there are bound to be others.  I'll let you
> decide.  For #2, you could do ../decoder.cc, for #1, if you want, you
> could detect that the RHS is empty and do the whole basename.  These
> ideas might be overkill.  (Don't you love how a simple idea always
> gets more complicated?)
>
>
Yea, given the amount of time I've spent on this already I'm not inclined to
add a lot of sophisticated handling for a few exceptional cases.  #2 in
particular doesn't seem that bad to me; it is ambiguous, but in a sort of
reasonable way, and adding a bunch of path-handling code seems like
overkill.  For #1, the output is less intuitive with the blank RHS, and it's
pretty easy to check that the target is the same length as the common prefix
to know that there's a problem.  The question is what to do about it... one
simple possibility is just to reverse the arrow:

 [   STRIP] ALPHA_SE/m5.fast <- .unstripped

Or I could trim back to the path separator:

 [   STRIP] ALPHA_SE/m5.fast.unstripped -> m5.fast

Or trim to the nearest '.' or path sep:

 [   STRIP] ALPHA_SE/m5.fast.unstripped -> .fast

Any preferences?

Steve
_______________________________________________
m5-dev mailing list
m5-dev@m5sim.org
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to