From dcd15f81789e389c1cb27d264fcdddfd0a6002bd Mon Sep 17 00:00:00 2001 From: emaste Date: Fri, 23 Aug 2013 17:46:38 +0000 Subject: Import lldb as of SVN r188801 (A number of files not required for the FreeBSD build have been removed.) Sponsored by: DARPA, AFRL --- source/Interpreter/OptionValueFileSpecLIst.cpp | 186 +++++++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 source/Interpreter/OptionValueFileSpecLIst.cpp (limited to 'source/Interpreter/OptionValueFileSpecLIst.cpp') diff --git a/source/Interpreter/OptionValueFileSpecLIst.cpp b/source/Interpreter/OptionValueFileSpecLIst.cpp new file mode 100644 index 0000000..e493c70 --- /dev/null +++ b/source/Interpreter/OptionValueFileSpecLIst.cpp @@ -0,0 +1,186 @@ +//===-- OptionValueFileSpecList.cpp -----------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "lldb/Interpreter/OptionValueFileSpecList.h" + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/Core/Stream.h" +#include "lldb/Interpreter/Args.h" + +using namespace lldb; +using namespace lldb_private; + +void +OptionValueFileSpecList::DumpValue (const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) +{ + if (dump_mask & eDumpOptionType) + strm.Printf ("(%s)", GetTypeAsCString ()); + if (dump_mask & eDumpOptionValue) + { + if (dump_mask & eDumpOptionType) + strm.Printf (" =%s", m_current_value.GetSize() > 0 ? "\n" : ""); + strm.IndentMore(); + const uint32_t size = m_current_value.GetSize(); + for (uint32_t i = 0; i 1) + { + uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX); + const uint32_t count = m_current_value.GetSize(); + if (idx > count) + { + error.SetErrorStringWithFormat("invalid file list index %u, index must be 0 through %u", idx, count); + } + else + { + for (size_t i=1; i 0) + { + m_value_was_set = true; + for (size_t i=0; i 1) + { + uint32_t idx = Args::StringToUInt32(args.GetArgumentAtIndex(0), UINT32_MAX); + const uint32_t count = m_current_value.GetSize(); + if (idx > count) + { + error.SetErrorStringWithFormat("invalid insert file list index %u, index must be 0 through %u", idx, count); + } + else + { + if (op == eVarSetOperationInsertAfter) + ++idx; + for (size_t i=1; i 0) + { + std::vector remove_indexes; + bool all_indexes_valid = true; + size_t i; + for (i=0; all_indexes_valid && i