本文整理汇总了C++中FileSpecList类的典型用法代码示例。如果您正苦于以下问题:C++ FileSpecList类的具体用法?C++ FileSpecList怎么用?C++ FileSpecList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FileSpecList类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
uint32_t
PlatformRemoteiOS::FindFileInAllSDKs (const char *platform_file_path,
FileSpecList &file_list)
{
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST | LIBLLDB_LOG_VERBOSE);
if (platform_file_path && platform_file_path[0] && UpdateSDKDirectoryInfosIfNeeded())
{
const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
lldb_private::FileSpec local_file;
// First try for an exact match of major, minor and update
for (uint32_t sdk_idx=0; sdk_idx<num_sdk_infos; ++sdk_idx)
{
if (log)
{
log->Printf ("Searching for %s in sdk path %s", platform_file_path, m_sdk_directory_infos[sdk_idx].directory.GetPath().c_str());
}
if (GetFileInSDK (platform_file_path,
sdk_idx,
local_file))
{
file_list.Append(local_file);
}
}
}
return file_list.GetSize();
}
示例2: if
size_t
FileSpecList::GetFilesMatchingPartialPath (const char *path, bool dir_okay, FileSpecList &matches)
{
#if 0 // FIXME: Just sketching...
matches.Clear();
FileSpec path_spec = FileSpec (path);
if (path_spec.Exists ())
{
FileSpec::FileType type = path_spec.GetFileType();
if (type == FileSpec::eFileTypeSymbolicLink)
// Shouldn't there be a Resolve on a file spec that real-path's it?
{
}
if (type == FileSpec::eFileTypeRegular
|| (type == FileSpec::eFileTypeDirectory && dir_okay))
{
matches.Append (path_spec);
return 1;
}
else if (type == FileSpec::eFileTypeDirectory)
{
// Fill the match list with all the files in the directory:
}
else
{
return 0;
}
}
else
{
ConstString dir_name = path_spec.GetDirectory();
Constring file_name = GetFilename();
if (dir_name == NULL)
{
// Match files in the CWD.
}
else
{
// Match files in the given directory:
}
}
#endif
return 0;
}
示例3: SerializeFileSpecList
void SearchFilter::SerializeFileSpecList(
StructuredData::DictionarySP &options_dict_sp, OptionNames name,
FileSpecList &file_list) {
size_t num_modules = file_list.GetSize();
// Don't serialize empty lists.
if (num_modules == 0)
return;
auto module_array_sp = std::make_shared<StructuredData::Array>();
for (size_t i = 0; i < num_modules; i++) {
module_array_sp->AddItem(std::make_shared<StructuredData::String>(
file_list.GetFileSpecAtIndex(i).GetPath()));
}
options_dict_sp->AddItem(GetKey(name), module_array_sp);
}
示例4: CreateFromStructuredData
lldb::SearchFilterSP SearchFilterByModuleListAndCU::CreateFromStructuredData(
Target &target, const StructuredData::Dictionary &data_dict,
Status &error) {
StructuredData::Array *modules_array = nullptr;
SearchFilterSP result_sp;
bool success = data_dict.GetValueForKeyAsArray(GetKey(OptionNames::ModList),
modules_array);
FileSpecList modules;
if (success) {
size_t num_modules = modules_array->GetSize();
for (size_t i = 0; i < num_modules; i++) {
llvm::StringRef module;
success = modules_array->GetItemAtIndexAsString(i, module);
if (!success) {
error.SetErrorStringWithFormat(
"SFBM::CFSD: filter module item %zu not a string.", i);
return result_sp;
}
modules.Append(FileSpec(module));
}
}
StructuredData::Array *cus_array = nullptr;
success =
data_dict.GetValueForKeyAsArray(GetKey(OptionNames::CUList), cus_array);
if (!success) {
error.SetErrorString("SFBM::CFSD: Could not find the CU list key.");
return result_sp;
}
size_t num_cus = cus_array->GetSize();
FileSpecList cus;
for (size_t i = 0; i < num_cus; i++) {
llvm::StringRef cu;
success = cus_array->GetItemAtIndexAsString(i, cu);
if (!success) {
error.SetErrorStringWithFormat(
"SFBM::CFSD: filter cu item %zu not a string.", i);
return nullptr;
}
cus.Append(FileSpec(cu));
}
return std::make_shared<SearchFilterByModuleListAndCU>(
target.shared_from_this(), modules, cus);
}
示例5:
uint32_t
ObjectFileJIT::GetDependentModules (FileSpecList& files)
{
// JIT modules don't have dependencies, but they could
// if external functions are called and we know where they are
files.Clear();
return 0;
}
示例6: FindFileInAllSDKs
uint32_t PlatformRemoteDarwinDevice::FindFileInAllSDKs(const char *platform_file_path,
FileSpecList &file_list) {
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
if (platform_file_path && platform_file_path[0] &&
UpdateSDKDirectoryInfosIfNeeded()) {
const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
lldb_private::FileSpec local_file;
// First try for an exact match of major, minor and update
for (uint32_t sdk_idx = 0; sdk_idx < num_sdk_infos; ++sdk_idx) {
LLDB_LOGV(log, "Searching for {0} in sdk path {1}", platform_file_path,
m_sdk_directory_infos[sdk_idx].directory);
if (GetFileInSDK(platform_file_path, sdk_idx, local_file)) {
file_list.Append(local_file);
}
}
}
return file_list.GetSize();
}
示例7:
uint32_t
PlatformRemoteiOS::FindFileInAllSDKs (const char *platform_file_path,
FileSpecList &file_list)
{
if (platform_file_path && platform_file_path[0] && UpdateSDKDirectoryInfosInNeeded())
{
const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
lldb_private::FileSpec local_file;
// First try for an exact match of major, minor and update
for (uint32_t sdk_idx=0; sdk_idx<num_sdk_infos; ++sdk_idx)
{
if (GetFileInSDK (platform_file_path,
sdk_idx,
local_file))
{
file_list.Append(local_file);
}
}
}
return file_list.GetSize();
}
示例8: ParseDependentModules
uint32_t
ObjectFileELF::GetDependentModules(FileSpecList &files)
{
size_t num_modules = ParseDependentModules();
uint32_t num_specs = 0;
for (unsigned i = 0; i < num_modules; ++i)
{
if (files.AppendIfUnique(m_filespec_ap->GetFileSpecAtIndex(i)))
num_specs++;
}
return num_specs;
}
示例9: SwiftREPL
lldb::REPLSP
SwiftREPL::CreateInstance (Error &err, lldb::LanguageType language, Debugger *debugger, Target *target, const char *repl_options)
{
if (language != eLanguageTypeSwift)
{
return lldb::REPLSP();
}
if (target)
{
// Sanity check the target to make sure a REPL would work here.
if (!target->GetProcessSP() ||
!target->GetProcessSP()->IsAlive())
{
err.SetErrorString ("can't launch a Swift REPL without a running process");
return lldb::REPLSP();
}
SymbolContextList sc_list;
target->GetImages().FindSymbolsWithNameAndType(ConstString("_swift_release"), eSymbolTypeAny, sc_list);
if (!sc_list.GetSize())
{
err.SetErrorString ("can't launch a Swift REPL in a process that doesn't have the Swift standard library");
return lldb::REPLSP();
}
// Sanity checks succeeded. Go ahead.
SwiftREPL *repl = new SwiftREPL(*target);
REPLSP repl_sp(repl);
repl->SetCompilerOptions(repl_options);
return repl_sp;
}
else if (debugger)
{
const char *bp_name = "repl_main";
FileSpec repl_executable;
if (HostInfo::GetLLDBPath (ePathTypeSupportExecutableDir, repl_executable))
{
repl_executable.GetFilename().SetCString("repl_swift");
std::string repl_exe_path(repl_executable.GetPath());
if (repl_executable.Exists())
{
const char *target_triple = NULL;
bool add_dependent_modules = true;
TargetSP target_sp;
err = debugger->GetTargetList().CreateTarget (*debugger,
repl_exe_path.c_str(),
target_triple,
add_dependent_modules,
NULL,
target_sp);
if (err.Success())
{
// Limit the breakpoint to our executable module
FileSpecList containingModules;
ModuleSP exe_module_sp (target_sp->GetExecutableModule());
if (exe_module_sp)
{
FileSpec exe_spec(exe_module_sp->GetFileSpec());
containingModules.Append(exe_spec);
BreakpointSP main_bp_sp = target_sp->CreateBreakpoint (&containingModules, // Limit to these modules
NULL, // Don't limit the breakpoint to any source files
bp_name, // Function name
eFunctionNameTypeAuto, // Name type
eLanguageTypeUnknown, // Language
0, // offset
eLazyBoolYes, // skip_prologue,
true, // internal
false); // request_hardware
if (main_bp_sp->GetNumLocations() > 0)
{
main_bp_sp->SetBreakpointKind("REPL");
assert (main_bp_sp->IsInternal()); // We made an internal breakpoint above, it better say it is internal
lldb_private::ProcessLaunchInfo launch_info;
const char *target_settings_argv0 = target_sp->GetArg0();
if (target_sp->GetDisableASLR())
launch_info.GetFlags().Set (eLaunchFlagDisableASLR);
if (target_sp->GetDisableSTDIO())
launch_info.GetFlags().Set (eLaunchFlagDisableSTDIO);
if (target_settings_argv0)
{
launch_info.GetArguments().AppendArgument (target_settings_argv0);
launch_info.SetExecutableFile(exe_module_sp->GetPlatformFileSpec(), false);
}
else
{
launch_info.SetExecutableFile(exe_module_sp->GetPlatformFileSpec(), true);
}
debugger->SetAsyncExecution(false);
err = target_sp->Launch(launch_info, nullptr);
//.........这里部分代码省略.........