[Lldb-commits] [PATCH] Skip symlinks to the original file when searching for debug info

jingham at apple.com jingham at apple.com
Mon Feb 23 13:23:52 PST 2015


> On Feb 23, 2015, at 1:17 PM, Zachary Turner <zturner at google.com> wrote:
> 
> In http://reviews.llvm.org/D7836#128511, @jingham wrote:
> 
>> That is not how we thought of FileSpec originally.  It clearly was meant to deal with real files (for instance it has Exists methods & Read, etc.)  It was meant to be a wrapper that would allow us to do all the useful file manipulation in a system-independent way.  It ended up with system dependencies just because we didn't have the time to keep it clean when there were no ports of lldb that weren't Unix...  But that's life, not design.
>> 
>> Anyway, it would be weird to have some object you use to denote the files you are interested in, but then when you actually want to do something with them, you have to turn around and use another object.  And it would be unfortunate to have to write system specific code at this point except for the - hopefully very few - cases where the sort of thing we want to do to a file is not able to be expressed in a system-independent way.
>> 
>> Jim
> 
> 
> Well, already we have introduced the notion of the path syntax so that FileSpec can in theory refer to a path that is invalid for the host you're on.  In that case it doesn't make much sense to have a Windows path, for example on Mac, and then try to do a file system operation on it.  When I refactored some of Host months ago, there were other methods directly in Host that would do things like get file permissions, etc.  So there was already some separation between the FileSpec and the methods that hit the file system.  Most of that stuff ended up in FileSystem, and the stuff that remains in FileSpec is only there because I couldn't change the public API.
> 
> But with the notion of a FileSpec that can refer to a path that can't possibly be on your local host, I think it makes sense to consider whether the file system access routines should be separated from FileSpec.

Not sure, wouldn't it be better to optionally attach a platform to FileSpec, so that FileSpecs can transparently handle remote access?  FileSpec's are how we specify files. Seems awkward to switch gears to something else when you actually want to access them.

Jim


> 
> 
> http://reviews.llvm.org/D7836
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> 
> 





More information about the lldb-commits mailing list