History log of /llvm-project-15.0.7/lldb/source/Host/common/FileSystem.cpp (Results 26 – 50 of 62)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 2fce1137 26-Sep-2019 Lawrence D'Anna <[email protected]>

Convert FileSystem::Open() to return Expected<FileUP>

Summary:
This patch converts FileSystem::Open from this prototype:

Status
Open(File &File, const FileSpec &file_spec, ...);

to this one:

llvm

Convert FileSystem::Open() to return Expected<FileUP>

Summary:
This patch converts FileSystem::Open from this prototype:

Status
Open(File &File, const FileSpec &file_spec, ...);

to this one:

llvm::Expected<std::unique_ptr<File>>
Open(const FileSpec &file_spec, ...);

This is beneficial on its own, as llvm::Expected is a more modern
and recommended error type than Status. It is also a necessary step
towards https://reviews.llvm.org/D67891, and further developments
for lldb_private::File.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: mgorny, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D67996

llvm-svn: 373003

show more ...


# 948786c9 23-Sep-2019 Jonas Devlieghere <[email protected]>

File::SetDescriptor() should require options

lvm_private::File::GetStream() can fail if m_options == 0

It's not clear from the header a File created with a descriptor will be
not be usable by many

File::SetDescriptor() should require options

lvm_private::File::GetStream() can fail if m_options == 0

It's not clear from the header a File created with a descriptor will be
not be usable by many parts of LLDB unless SetOptions is also called,
but it is.

This is because those parts of LLDB rely on GetStream() to use the
file, and that in turn relies on calling fdopen on the descriptor. When
calling fdopen, GetStream relies on m_options to determine the access
mode. If m_options has never been set, GetStream() will fail.

This patch adds options as a required argument to File::SetDescriptor
and the corresponding constructor.

Patch by: Lawrence D'Anna

Differential revision: https://reviews.llvm.org/D67792

llvm-svn: 372652

show more ...


Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3, llvmorg-9.0.0-rc2
# 96b44c77 29-Jul-2019 Jonas Devlieghere <[email protected]>

[Reproducers] Pass FileCollector around as a shared_ptr (NFC)

Instead of passing the FileCollector around as a reference or raw
pointer, use a shared_ptr. This change's motivation is twofold. First

[Reproducers] Pass FileCollector around as a shared_ptr (NFC)

Instead of passing the FileCollector around as a reference or raw
pointer, use a shared_ptr. This change's motivation is twofold. First it
adds compatibility for the newly added `FileCollectorFileSystem`.
Secondly, it addresses a lifetime issue we only see when LLDB is used
from Xcode, where a reference to the FileCollector outlives the
reproducer instance.

llvm-svn: 367258

show more ...


Revision tags: llvmorg-9.0.0-rc1
# e9be72a3 25-Jul-2019 Jonas Devlieghere <[email protected]>

[FileCollector] Remove LLDB shim around llvm::FileCollector (NFC)

The FileCollector got lifted into LLVM and a shim was introduced in LLDB
to keep the old API that takes FileSpecs. This patch remove

[FileCollector] Remove LLDB shim around llvm::FileCollector (NFC)

The FileCollector got lifted into LLVM and a shim was introduced in LLDB
to keep the old API that takes FileSpecs. This patch removes that shim
and converts the arguments in place.

llvm-svn: 366975

show more ...


# 69b63da1 25-Jul-2019 Jonas Devlieghere <[email protected]>

[FileSystem] Fix ambiguous symbol on Windows.

The using declarations make FileCollector ambiguous. Specify that
FileSystem takes an lldb_private::FileCollector.

llvm-svn: 366974


# eb1b4c5d 25-Jul-2019 Jonas Devlieghere <[email protected]>

[FileCollector] Change coding style from LLDB to LLVM (NFC)

This patch changes the coding style of the FileCollector from the LLDB
to the LLVM coding style. Alex recently lifted it into LLVM and I
v

[FileCollector] Change coding style from LLDB to LLVM (NFC)

This patch changes the coding style of the FileCollector from the LLDB
to the LLVM coding style. Alex recently lifted it into LLVM and I
volunteered to do the conversion.

llvm-svn: 366966

show more ...


Revision tags: llvmorg-10-init, llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3
# c470ac50 18-Jun-2019 Jonas Devlieghere <[email protected]>

[Reproducers] Make reproducer relocatable

Before this patch, reproducers weren't relocatable. The reproducer
contained hard coded paths in the VFS mapping, as well in the yaml file
listing the diffe

[Reproducers] Make reproducer relocatable

Before this patch, reproducers weren't relocatable. The reproducer
contained hard coded paths in the VFS mapping, as well in the yaml file
listing the different input files for the command interpreter. This
patch changes that:

- Use relative paths for the DataCollector.
- Use an overlay prefix for the FileCollector.

Differential revision: https://reviews.llvm.org/D63467

llvm-svn: 363697

show more ...


Revision tags: llvmorg-8.0.1-rc2
# feb99530 21-May-2019 Jonas Devlieghere <[email protected]>

[FileSystem] Fix regression in FileSystem::Resolve

When I moved the resolve code from FileSpec to the FileSystem class, I
introduced a regression. If you compare the two implementations, you'll
noti

[FileSystem] Fix regression in FileSystem::Resolve

When I moved the resolve code from FileSpec to the FileSystem class, I
introduced a regression. If you compare the two implementations, you'll
notice that if the path doesn't exist, we should only reverse the
effects of makeAbsolute, not the effects of tilde expansion.

As a result, the logic to create the ~/.lldb directory broke, because we
would resolve the path before creating it. Because the directory didn't
exist yet, we'd call create_directories on the unresolved path, which
failed.

Differential revision: https://reviews.llvm.org/D62219

llvm-svn: 361321

show more ...


Revision tags: llvmorg-8.0.1-rc1, llvmorg-8.0.0
# 81d03f3a 13-Mar-2019 Adrian Prantl <[email protected]>

Make sure FileSystem::Resolve preserves the path/file distinction.

This should finally fix TestPaths.py.

llvm-svn: 356057


Revision tags: llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4
# 0e4c4821 06-Mar-2019 Adrian Prantl <[email protected]>

Pass ConstString by value (NFC)

My apologies for the large patch. With the exception of ConstString.h
itself it was entirely produced by sed.

ConstString has exactly one const char * data member, s

Pass ConstString by value (NFC)

My apologies for the large patch. With the exception of ConstString.h
itself it was entirely produced by sed.

ConstString has exactly one const char * data member, so passing a
ConstString by reference is not any more efficient than copying it by
value. In both cases a single pointer is passed. But passing it by
value makes it harder to accidentally return the address of a local
object.

(This fixes rdar://problem/48640859 for the Apple folks)

Differential Revision: https://reviews.llvm.org/D59030

llvm-svn: 355553

show more ...


Revision tags: llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1
# 3a142495 07-Feb-2019 Aaron Smith <[email protected]>

[lldb-server] Improve support on Windows

Summary:
This commit contains the following changes:

- Rewrite vfile close/read/write packet handlers with portable routines from lldb.
This removes #

[lldb-server] Improve support on Windows

Summary:
This commit contains the following changes:

- Rewrite vfile close/read/write packet handlers with portable routines from lldb.
This removes #if(s) and allows the handlers to work on Windows.

- Fix a bug in File::Write. This is intended to write data at an offset to a file
but actually writes at the current position of the file.

- Add a default boolean argument 'should_close_fd' to FileSystem::Open to
let the user decide whether to close the fd or not.

Reviewers: zturner, llvm-commits, labath

Reviewed By: zturner

Subscribers: Hui, labath, abidh, lldb-commits

Differential Revision: https://reviews.llvm.org/D56231

llvm-svn: 353446

show more ...


Revision tags: llvmorg-8.0.0-rc2
# 46575176 29-Jan-2019 Jonas Devlieghere <[email protected]>

[Reproducers] Add file provider

This patch adds the file provider which is responsible for capturing
files used by LLDB.

When capturing a reproducer, we use a file collector that is very
similar to

[Reproducers] Add file provider

This patch adds the file provider which is responsible for capturing
files used by LLDB.

When capturing a reproducer, we use a file collector that is very
similar to the one used in clang. For every file that we touch, we add
an entry with a mapping from its virtual to its real path. When we
decide to generate a reproducer we copy over the files and their
permission into to reproducer folder.

When replaying a reproducer, we load the VFS mapping and instantiate a
RedirectingFileSystem. The latter will transparently use the files
available in the reproducer.

I've tested this on two macOS machines with an artificial example.
Still, it is very likely that I missed some places where we (still) use
native file system calls. I'm hoping to flesh those out while testing
with more advanced examples. However, I will fix those things in
separate patches.

Differential revision: https://reviews.llvm.org/D54617

llvm-svn: 352538

show more ...


Revision tags: llvmorg-8.0.0-rc1
# 2946cd70 19-Jan-2019 Chandler Carruth <[email protected]>

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the ne

Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636

show more ...


Revision tags: llvmorg-7.0.1, llvmorg-7.0.1-rc3
# edaf2bcc 04-Dec-2018 Jonas Devlieghere <[email protected]>

[FileSystem] Migrate CommandCompletions

Make use of the convenience helpers from FileSystem.

Differential revision: https://reviews.llvm.org/D55240

llvm-svn: 348287


# 010b56be 27-Nov-2018 Jonas Devlieghere <[email protected]>

Move time cast to SymbolFileDWARFDebugMap

When trying to fix the bots we expected that the cast would be needed in
different places. Ultimately it turned out only the
SymbolFileDWARFDebugMap was aff

Move time cast to SymbolFileDWARFDebugMap

When trying to fix the bots we expected that the cast would be needed in
different places. Ultimately it turned out only the
SymbolFileDWARFDebugMap was affected so, as Pavel correctly notes, it
makes more sense to do the cast just there instead of in teh FS.

llvm-svn: 347660

show more ...


# 2765b067 26-Nov-2018 Jonas Devlieghere <[email protected]>

[FileSystem] Ignore nanoseconds when comparing oso_mod_time

After a recent change in LLVM the TimePoint encoding become more
precise, exceeding the precision of the TimePoint obtained from the
Debug

[FileSystem] Ignore nanoseconds when comparing oso_mod_time

After a recent change in LLVM the TimePoint encoding become more
precise, exceeding the precision of the TimePoint obtained from the
DebugMap. This patch adds a flag to the GetModificationTime helper in
the FileSystem to return the modification time with less precision.

Thanks to Davide for bisecting this failure on the LLDB bots.

llvm-svn: 347615

show more ...


# 87e403aa 12-Nov-2018 Jonas Devlieghere <[email protected]>

Re-land "Extract construction of DataBufferLLVM into FileSystem"

This fixes some UB in isLocal detected by the sanitized bot.

llvm-svn: 346707


# 9a89d93d 12-Nov-2018 Davide Italiano <[email protected]>

Revert "Extract construction of DataBufferLLVM into FileSystem"

It broke the lldb sanitizer bots.

llvm-svn: 346694


# 1cc0714c 10-Nov-2018 Jonas Devlieghere <[email protected]>

Extract construction of DataBufferLLVM into FileSystem

This moves construction of data buffers into the FileSystem class. Like
some of the previous refactorings we don't translate the path yet
becau

Extract construction of DataBufferLLVM into FileSystem

This moves construction of data buffers into the FileSystem class. Like
some of the previous refactorings we don't translate the path yet
because the functionality hasn't been landed in LLVM yet.

Differential revision: https://reviews.llvm.org/D54272

llvm-svn: 346598

show more ...


# 72787ac6 09-Nov-2018 Jonas Devlieghere <[email protected]>

Revert "[FileSystem] Make use of FS in TildeExpressionResolver"

The whole point of this change was making it possible to resolve paths
without depending on the FileSystem, which is not what I did he

Revert "[FileSystem] Make use of FS in TildeExpressionResolver"

The whole point of this change was making it possible to resolve paths
without depending on the FileSystem, which is not what I did here. Not
sure what I was thinking...

llvm-svn: 346466

show more ...


# 9560f353 09-Nov-2018 Jonas Devlieghere <[email protected]>

[FileSystem] Make use of FS in TildeExpressionResolver

In order to call real_path from the TildeExpressionResolver we need
access to the FileSystem. Since the resolver lives under utility we have
to

[FileSystem] Make use of FS in TildeExpressionResolver

In order to call real_path from the TildeExpressionResolver we need
access to the FileSystem. Since the resolver lives under utility we have
to pass in the FS.

llvm-svn: 346457

show more ...


# 3a58d898 08-Nov-2018 Jonas Devlieghere <[email protected]>

[FileSystem] Add convenience method to check for directories.

Replace calls to LLVM's is_directory with calls to LLDB's FileSytem
class. For this I introduced a new convenience method that, like the

[FileSystem] Add convenience method to check for directories.

Replace calls to LLVM's is_directory with calls to LLDB's FileSytem
class. For this I introduced a new convenience method that, like the
other methods, takes either a path or filespec. This still uses the LLVM
functions under the hood.

Differential revision: https://reviews.llvm.org/D54135

llvm-svn: 346375

show more ...


# 50bc1ed2 02-Nov-2018 Jonas Devlieghere <[email protected]>

[FileSystem] Open File instances through the FileSystem.

This patch modifies how we open File instances in LLDB. Rather than
passing a path or FileSpec to the constructor, we now go through the
virt

[FileSystem] Open File instances through the FileSystem.

This patch modifies how we open File instances in LLDB. Rather than
passing a path or FileSpec to the constructor, we now go through the
virtual file system. This is needed in order to make things work with
the VFS in the future.

Differential revision: https://reviews.llvm.org/D54020

llvm-svn: 346049

show more ...


Revision tags: llvmorg-7.0.1-rc2
# 12950118 02-Nov-2018 Jonas Devlieghere <[email protected]>

[FileSystem] Remove `SetFileSystem` method.

This is no longer relevant with the new way we initialize the
FileSystem.

llvm-svn: 346003


Revision tags: llvmorg-7.0.1-rc1
# 73ed6071 01-Nov-2018 Jonas Devlieghere <[email protected]>

[File] Remove static method to get permissions.

This patch removes the static accessor in File to get a file's
permissions. Permissions should be checked through the FileSystem class.

llvm-svn: 345

[File] Remove static method to get permissions.

This patch removes the static accessor in File to get a file's
permissions. Permissions should be checked through the FileSystem class.

llvm-svn: 345901

show more ...


123