llvm/lldb/source/Target/PathMappingList.cpp

//===-- PathMappingList.cpp -----------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include <climits>
#include <cstring>
#include <optional>

#include "lldb/Host/FileSystem.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Target/PathMappingList.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
#include "lldb/lldb-private-enumerations.h"

usingnamespacelldb;
usingnamespacelldb_private;

namespace {
  // We must normalize our path pairs that we store because if we don't then
  // things won't always work. We found a case where if we did:
  // (lldb) settings set target.source-map . /tmp
  // We would store a path pairs of "." and "/tmp" as raw strings. If the debug
  // info contains "./foo/bar.c", the path will get normalized to "foo/bar.c".
  // When PathMappingList::RemapPath() is called, it expects the path to start
  // with the raw path pair, which doesn't work anymore because the paths have
  // been normalized when the debug info was loaded. So we need to store
  // nomalized path pairs to ensure things match up.
std::string NormalizePath(llvm::StringRef path) {}
}
// PathMappingList constructor
PathMappingList::PathMappingList() :{}

PathMappingList::PathMappingList(ChangedCallback callback, void *callback_baton)
    :{}

PathMappingList::PathMappingList(const PathMappingList &rhs)
    :{}

const PathMappingList &PathMappingList::operator=(const PathMappingList &rhs) {}

PathMappingList::~PathMappingList() = default;

void PathMappingList::Append(llvm::StringRef path, llvm::StringRef replacement,
                             bool notify) {}

void PathMappingList::Append(const PathMappingList &rhs, bool notify) {}

bool PathMappingList::AppendUnique(llvm::StringRef path,
                                   llvm::StringRef replacement, bool notify) {}

void PathMappingList::Insert(llvm::StringRef path, llvm::StringRef replacement,
                             uint32_t index, bool notify) {}

bool PathMappingList::Replace(llvm::StringRef path, llvm::StringRef replacement,
                              uint32_t index, bool notify) {}

bool PathMappingList::Remove(size_t index, bool notify) {}

// For clients which do not need the pair index dumped, pass a pair_index >= 0
// to only dump the indicated pair.
void PathMappingList::Dump(Stream *s, int pair_index) {}

llvm::json::Value PathMappingList::ToJSON() {}

void PathMappingList::Clear(bool notify) {}

bool PathMappingList::RemapPath(ConstString path,
                                ConstString &new_path) const {}

/// Append components to path, applying style.
static void AppendPathComponents(FileSpec &path, llvm::StringRef components,
                                 llvm::sys::path::Style style) {}

std::optional<FileSpec> PathMappingList::RemapPath(llvm::StringRef mapping_path,
                                                   bool only_if_exists) const {}

std::optional<llvm::StringRef>
PathMappingList::ReverseRemapPath(const FileSpec &file, FileSpec &fixed) const {}

std::optional<FileSpec>
PathMappingList::FindFile(const FileSpec &orig_spec) const {}

bool PathMappingList::Replace(llvm::StringRef path, llvm::StringRef new_path,
                              bool notify) {}

bool PathMappingList::Remove(ConstString path, bool notify) {}

PathMappingList::const_iterator
PathMappingList::FindIteratorForPath(ConstString path) const {}

PathMappingList::iterator
PathMappingList::FindIteratorForPath(ConstString path) {}

bool PathMappingList::GetPathsAtIndex(uint32_t idx, ConstString &path,
                                      ConstString &new_path) const {}

uint32_t PathMappingList::FindIndexForPath(llvm::StringRef orig_path) const {}