[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-debug-dev] Translating cross compiled paths
|
> > There is already some code in CDT that makes use of
> > the Cygwin 'cygpath' utility to translate to/from POSIX
> > paths where needed. You may want to examine where this
> > is currently used, and see if you can generalize the
> > usage patterns. I've been meaning to do something
> > similar, but haven't had the time to make a serious
> > effort about it.
>
> Sigh, please ignore the comment on cygpath... I somehow
> failed to notice your attachment, and of course, you are
> indeed using cygpath.
>
> Looking at your implementation, I'm trying to understand
> what/when you would want to use this class. It looks as
> if you are assuming a path relative to an existing windows
> directory, and falling back to calling cygpath if that
> fails. I would think that you'd at least want to reverse
> the order (try cygpath, then fall back to assuming a
> relative directory).
To be honest, this is a hack and slash job. There are lots of things I
did after experimenting a bit in the debugger that I either don't
understand or I know isn't the "proper" way to do things.
However, my general plan is to introduce a concept in the CDT code that
paths that are handed to it from GDB commands or are discovered in the
.elf binaries are to be interpreted as cribs as to where the source
files might be rather than to be interpreted as actual file paths.
The translation from path cribs to absolute paths must be implemented in
a platform specific fashion. I've only fiddled with CDT running under
Windows for embedded targets.
> A better solution would probably be to understand that
> the build platform is Cygwin, and therefore, Cygwin type
> paths should be passed to tools.
I actually had to ditch the current CygPathTranslator since it returned
empty paths. Haven't investigated why(it uses all sorts of unfamiliar
Eclipse/CDT classes), but rewriting a placeholder was the quickest
option.
> Another concern would be handling of Cygwin mount points.
> This can be a problem in some instances. I'm not sure if
> you run afoul of that, as you're only translating paths
> in one direction, but it's something to be aware of.
cygpath can translate the other way as well, but currently I haven't
needed that.
> There are a couple of other potential problems (more recent
> versions of cygpath can handle multiple paths at once, the
> cygdrive prefix can be altered by the user, properly escaping
> spaces, etc.) There are a lot of little things that make the
> problem of path translation under Cygwin more complicated
> than you'd want it to be :-/
Sure. Thats why I want to switch back to using CygPathTranslator, rather
than my home-baked workaround.
--
Øyvind Harboe
http://www.zylin.com