[lldb][NFC] Fix all formatting errors in .cpp file headers
Summary:
A *.cpp file header in LLDB (and in LLDB) should like this:
```
//===-- TestUtilities.cpp -------------------------------------------------===//
```
However in LLDB most of our source files have arbitrary changes to this format and
these changes are spreading through LLDB as folks usually just use the existing
source files as templates for their new files (most notably the unnecessary
editor language indicator `-*- C++ -*-` is spreading and in every review
someone is pointing out that this is wrong, resulting in people pointing out that this
is done in the same way in other files).
This patch removes most of these inconsistencies including the editor language indicators,
all the different missing/additional '-' characters, files that center the file name, missing
trailing `===//` (mostly caused by clang-format breaking the line).
Reviewers: aprantl, espindola, jfb, shafik, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: dexonsmith, wuzish, emaste, sdardis, nemanjai, kbarton, MaskRay, atanasyan, arphaman, jfb, abidh, jsji, JDevlieghere, usaxena95, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D73258
2020-01-24 15:23:27 +08:00
|
|
|
//===-- OptionValue.cpp ---------------------------------------------------===//
|
2012-08-23 01:17:09 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// 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
|
2012-08-23 01:17:09 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/Interpreter/OptionValue.h"
|
|
|
|
#include "lldb/Interpreter/OptionValues.h"
|
2017-03-22 02:25:04 +08:00
|
|
|
#include "lldb/Utility/StringList.h"
|
2012-08-23 01:17:09 +08:00
|
|
|
|
2020-06-20 02:17:00 +08:00
|
|
|
#include <memory>
|
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
2018-05-01 00:49:04 +08:00
|
|
|
// Get this value as a uint64_t value if it is encoded as a boolean, uint64_t
|
|
|
|
// or int64_t. Other types will cause "fail_value" to be returned
|
2012-08-23 01:17:09 +08:00
|
|
|
uint64_t OptionValue::GetUInt64Value(uint64_t fail_value, bool *success_ptr) {
|
|
|
|
if (success_ptr)
|
|
|
|
*success_ptr = true;
|
|
|
|
switch (GetType()) {
|
|
|
|
case OptionValue::eTypeBoolean:
|
|
|
|
return static_cast<OptionValueBoolean *>(this)->GetCurrentValue();
|
|
|
|
case OptionValue::eTypeSInt64:
|
|
|
|
return static_cast<OptionValueSInt64 *>(this)->GetCurrentValue();
|
|
|
|
case OptionValue::eTypeUInt64:
|
|
|
|
return static_cast<OptionValueUInt64 *>(this)->GetCurrentValue();
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (success_ptr)
|
|
|
|
*success_ptr = false;
|
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status OptionValue::SetSubValue(const ExecutionContext *exe_ctx,
|
|
|
|
VarSetOperationType op, llvm::StringRef name,
|
|
|
|
llvm::StringRef value) {
|
|
|
|
Status error;
|
2020-07-21 13:57:06 +08:00
|
|
|
error.SetErrorString("SetSubValue is not supported");
|
2012-08-23 01:17:09 +08:00
|
|
|
return error;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueBoolean *OptionValue::GetAsBoolean() {
|
2015-01-13 04:44:02 +08:00
|
|
|
if (GetType() == OptionValue::eTypeBoolean)
|
|
|
|
return static_cast<OptionValueBoolean *>(this);
|
|
|
|
return nullptr;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueBoolean *OptionValue::GetAsBoolean() const {
|
|
|
|
if (GetType() == OptionValue::eTypeBoolean)
|
|
|
|
return static_cast<const OptionValueBoolean *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueChar *OptionValue::GetAsChar() const {
|
|
|
|
if (GetType() == OptionValue::eTypeChar)
|
|
|
|
return static_cast<const OptionValueChar *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueChar *OptionValue::GetAsChar() {
|
|
|
|
if (GetType() == OptionValue::eTypeChar)
|
|
|
|
return static_cast<OptionValueChar *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueFileSpec *OptionValue::GetAsFileSpec() {
|
|
|
|
if (GetType() == OptionValue::eTypeFileSpec)
|
|
|
|
return static_cast<OptionValueFileSpec *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const OptionValueFileSpec *OptionValue::GetAsFileSpec() const {
|
|
|
|
if (GetType() == OptionValue::eTypeFileSpec)
|
|
|
|
return static_cast<const OptionValueFileSpec *>(this);
|
2015-01-13 04:44:02 +08:00
|
|
|
return nullptr;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-08-23 01:17:09 +08:00
|
|
|
|
|
|
|
OptionValueFileSpecList *OptionValue::GetAsFileSpecList() {
|
|
|
|
if (GetType() == OptionValue::eTypeFileSpecList)
|
|
|
|
return static_cast<OptionValueFileSpecList *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const OptionValueFileSpecList *OptionValue::GetAsFileSpecList() const {
|
|
|
|
if (GetType() == OptionValue::eTypeFileSpecList)
|
|
|
|
return static_cast<const OptionValueFileSpecList *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
2015-01-13 04:44:02 +08:00
|
|
|
OptionValueArch *OptionValue::GetAsArch() {
|
2012-08-23 01:17:09 +08:00
|
|
|
if (GetType() == OptionValue::eTypeArch)
|
|
|
|
return static_cast<OptionValueArch *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-08-23 01:17:09 +08:00
|
|
|
|
|
|
|
const OptionValueArch *OptionValue::GetAsArch() const {
|
|
|
|
if (GetType() == OptionValue::eTypeArch)
|
|
|
|
return static_cast<const OptionValueArch *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OptionValueArray *OptionValue::GetAsArray() {
|
|
|
|
if (GetType() == OptionValue::eTypeArray)
|
|
|
|
return static_cast<OptionValueArray *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const OptionValueArray *OptionValue::GetAsArray() const {
|
|
|
|
if (GetType() == OptionValue::eTypeArray)
|
|
|
|
return static_cast<const OptionValueArray *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-08-23 01:17:09 +08:00
|
|
|
|
|
|
|
OptionValueArgs *OptionValue::GetAsArgs() {
|
|
|
|
if (GetType() == OptionValue::eTypeArgs)
|
|
|
|
return static_cast<OptionValueArgs *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const OptionValueArgs *OptionValue::GetAsArgs() const {
|
|
|
|
if (GetType() == OptionValue::eTypeArgs)
|
|
|
|
return static_cast<const OptionValueArgs *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OptionValueDictionary *OptionValue::GetAsDictionary() {
|
|
|
|
if (GetType() == OptionValue::eTypeDictionary)
|
|
|
|
return static_cast<OptionValueDictionary *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const OptionValueDictionary *OptionValue::GetAsDictionary() const {
|
|
|
|
if (GetType() == OptionValue::eTypeDictionary)
|
|
|
|
return static_cast<const OptionValueDictionary *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OptionValueEnumeration *OptionValue::GetAsEnumeration() {
|
|
|
|
if (GetType() == OptionValue::eTypeEnum)
|
|
|
|
return static_cast<OptionValueEnumeration *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const OptionValueEnumeration *OptionValue::GetAsEnumeration() const {
|
|
|
|
if (GetType() == OptionValue::eTypeEnum)
|
|
|
|
return static_cast<const OptionValueEnumeration *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OptionValueFormat *OptionValue::GetAsFormat() {
|
|
|
|
if (GetType() == OptionValue::eTypeFormat)
|
|
|
|
return static_cast<OptionValueFormat *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
2015-02-21 03:46:30 +08:00
|
|
|
const OptionValueFormat *OptionValue::GetAsFormat() const {
|
|
|
|
if (GetType() == OptionValue::eTypeFormat)
|
|
|
|
return static_cast<const OptionValueFormat *>(this);
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
OptionValueLanguage *OptionValue::GetAsLanguage() {
|
|
|
|
if (GetType() == OptionValue::eTypeLanguage)
|
|
|
|
return static_cast<OptionValueLanguage *>(this);
|
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary:
NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codebase by using
`nullptr` instread of `0` or `NULL`. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.
This is the command I ran and I to fix and format the code base:
```
run-clang-tidy.py \
-header-filter='.*' \
-checks='-*,modernize-use-nullptr' \
-fix ~/dev/llvm-project/lldb/.* \
-format \
-style LLVM \
-p ~/llvm-builds/debug-ninja-gcc
```
NOTE: There were also changes to `llvm/utils/unittest` but I did not
include them because I felt that maybe this library shall be updated in
isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most
parts.
Reviewers: martong, espindola, shafik, #lldb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D61847
llvm-svn: 361484
2019-05-23 19:14:47 +08:00
|
|
|
return nullptr;
|
2015-02-21 03:46:30 +08:00
|
|
|
}
|
|
|
|
|
2015-02-05 06:00:53 +08:00
|
|
|
const OptionValueLanguage *OptionValue::GetAsLanguage() const {
|
|
|
|
if (GetType() == OptionValue::eTypeLanguage)
|
|
|
|
return static_cast<const OptionValueLanguage *>(this);
|
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary:
NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]]
This commit is the result of modernizing the LLDB codebase by using
`nullptr` instread of `0` or `NULL`. See
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html
for more information.
This is the command I ran and I to fix and format the code base:
```
run-clang-tidy.py \
-header-filter='.*' \
-checks='-*,modernize-use-nullptr' \
-fix ~/dev/llvm-project/lldb/.* \
-format \
-style LLVM \
-p ~/llvm-builds/debug-ninja-gcc
```
NOTE: There were also changes to `llvm/utils/unittest` but I did not
include them because I felt that maybe this library shall be updated in
isolation somehow.
NOTE: I know this is a rather large commit but it is a nobrainer in most
parts.
Reviewers: martong, espindola, shafik, #lldb, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits
Tags: #lldb, #llvm
Differential Revision: https://reviews.llvm.org/D61847
llvm-svn: 361484
2019-05-23 19:14:47 +08:00
|
|
|
return nullptr;
|
2015-02-05 06:00:53 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OptionValueFormatEntity *OptionValue::GetAsFormatEntity() {
|
|
|
|
if (GetType() == OptionValue::eTypeFormatEntity)
|
|
|
|
return static_cast<OptionValueFormatEntity *>(this);
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueFormatEntity *OptionValue::GetAsFormatEntity() const {
|
|
|
|
if (GetType() == OptionValue::eTypeFormatEntity)
|
|
|
|
return static_cast<const OptionValueFormatEntity *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OptionValuePathMappings *OptionValue::GetAsPathMappings() {
|
|
|
|
if (GetType() == OptionValue::eTypePathMap)
|
|
|
|
return static_cast<OptionValuePathMappings *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
const OptionValuePathMappings *OptionValue::GetAsPathMappings() const {
|
|
|
|
if (GetType() == OptionValue::eTypePathMap)
|
|
|
|
return static_cast<const OptionValuePathMappings *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
OptionValueProperties *OptionValue::GetAsProperties() {
|
|
|
|
if (GetType() == OptionValue::eTypeProperties)
|
|
|
|
return static_cast<OptionValueProperties *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-02-05 06:00:53 +08:00
|
|
|
const OptionValueProperties *OptionValue::GetAsProperties() const {
|
2012-08-23 01:17:09 +08:00
|
|
|
if (GetType() == OptionValue::eTypeProperties)
|
|
|
|
return static_cast<const OptionValueProperties *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueRegex *OptionValue::GetAsRegex() {
|
|
|
|
if (GetType() == OptionValue::eTypeRegex)
|
|
|
|
return static_cast<OptionValueRegex *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueRegex *OptionValue::GetAsRegex() const {
|
|
|
|
if (GetType() == OptionValue::eTypeRegex)
|
|
|
|
return static_cast<const OptionValueRegex *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueSInt64 *OptionValue::GetAsSInt64() {
|
|
|
|
if (GetType() == OptionValue::eTypeSInt64)
|
|
|
|
return static_cast<OptionValueSInt64 *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueSInt64 *OptionValue::GetAsSInt64() const {
|
|
|
|
if (GetType() == OptionValue::eTypeSInt64)
|
|
|
|
return static_cast<const OptionValueSInt64 *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueString *OptionValue::GetAsString() {
|
|
|
|
if (GetType() == OptionValue::eTypeString)
|
|
|
|
return static_cast<OptionValueString *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueString *OptionValue::GetAsString() const {
|
|
|
|
if (GetType() == OptionValue::eTypeString)
|
|
|
|
return static_cast<const OptionValueString *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueUInt64 *OptionValue::GetAsUInt64() {
|
|
|
|
if (GetType() == OptionValue::eTypeUInt64)
|
|
|
|
return static_cast<OptionValueUInt64 *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueUInt64 *OptionValue::GetAsUInt64() const {
|
|
|
|
if (GetType() == OptionValue::eTypeUInt64)
|
|
|
|
return static_cast<const OptionValueUInt64 *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueUUID *OptionValue::GetAsUUID() {
|
|
|
|
if (GetType() == OptionValue::eTypeUUID)
|
|
|
|
return static_cast<OptionValueUUID *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueUUID *OptionValue::GetAsUUID() const {
|
|
|
|
if (GetType() == OptionValue::eTypeUUID)
|
|
|
|
return static_cast<const OptionValueUUID *>(this);
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::GetBooleanValue(bool fail_value) const {
|
|
|
|
const OptionValueBoolean *option_value = GetAsBoolean();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::SetBooleanValue(bool new_value) {
|
|
|
|
OptionValueBoolean *option_value = GetAsBoolean();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(new_value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-01-13 04:44:02 +08:00
|
|
|
char OptionValue::GetCharValue(char fail_value) const {
|
|
|
|
const OptionValueChar *option_value = GetAsChar();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-01-13 04:44:02 +08:00
|
|
|
char OptionValue::SetCharValue(char new_value) {
|
|
|
|
OptionValueChar *option_value = GetAsChar();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(new_value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
int64_t OptionValue::GetEnumerationValue(int64_t fail_value) const {
|
|
|
|
const OptionValueEnumeration *option_value = GetAsEnumeration();
|
|
|
|
if (option_value)
|
<rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
Cleaned up header includes a bit as well.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
return option_value->GetCurrentValue();
|
2012-08-23 01:17:09 +08:00
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::SetEnumerationValue(int64_t value) {
|
|
|
|
OptionValueEnumeration *option_value = GetAsEnumeration();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
FileSpec OptionValue::GetFileSpecValue() const {
|
|
|
|
const OptionValueFileSpec *option_value = GetAsFileSpec();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return FileSpec();
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::SetFileSpecValue(const FileSpec &file_spec) {
|
|
|
|
OptionValueFileSpec *option_value = GetAsFileSpec();
|
|
|
|
if (option_value) {
|
2012-08-23 02:39:03 +08:00
|
|
|
option_value->SetCurrentValue(file_spec, false);
|
2012-08-23 01:17:09 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
FileSpecList OptionValue::GetFileSpecListValue() const {
|
|
|
|
const OptionValueFileSpecList *option_value = GetAsFileSpecList();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return FileSpecList();
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
lldb::Format OptionValue::GetFormatValue(lldb::Format fail_value) const {
|
|
|
|
const OptionValueFormat *option_value = GetAsFormat();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::SetFormatValue(lldb::Format new_value) {
|
|
|
|
OptionValueFormat *option_value = GetAsFormat();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(new_value);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-02-21 03:46:30 +08:00
|
|
|
lldb::LanguageType
|
|
|
|
OptionValue::GetLanguageValue(lldb::LanguageType fail_value) const {
|
|
|
|
const OptionValueLanguage *option_value = GetAsLanguage();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-02-21 03:46:30 +08:00
|
|
|
bool OptionValue::SetLanguageValue(lldb::LanguageType new_language) {
|
|
|
|
OptionValueLanguage *option_value = GetAsLanguage();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(new_language);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2015-02-05 06:00:53 +08:00
|
|
|
const FormatEntity::Entry *OptionValue::GetFormatEntity() const {
|
|
|
|
const OptionValueFormatEntity *option_value = GetAsFormatEntity();
|
|
|
|
if (option_value)
|
|
|
|
return &option_value->GetCurrentValue();
|
|
|
|
return nullptr;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const RegularExpression *OptionValue::GetRegexValue() const {
|
|
|
|
const OptionValueRegex *option_value = GetAsRegex();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return nullptr;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
int64_t OptionValue::GetSInt64Value(int64_t fail_value) const {
|
|
|
|
const OptionValueSInt64 *option_value = GetAsSInt64();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
2014-04-20 08:31:37 +08:00
|
|
|
return fail_value;
|
2012-08-23 01:17:09 +08:00
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::SetSInt64Value(int64_t new_value) {
|
|
|
|
OptionValueSInt64 *option_value = GetAsSInt64();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(new_value);
|
|
|
|
return true;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-08-23 01:17:09 +08:00
|
|
|
return false;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2016-11-18 02:08:12 +08:00
|
|
|
llvm::StringRef OptionValue::GetStringValue(llvm::StringRef fail_value) const {
|
2012-08-23 01:17:09 +08:00
|
|
|
const OptionValueString *option_value = GetAsString();
|
|
|
|
if (option_value)
|
2016-11-18 02:08:12 +08:00
|
|
|
return option_value->GetCurrentValueAsRef();
|
2012-08-23 01:17:09 +08:00
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2016-09-24 02:06:53 +08:00
|
|
|
bool OptionValue::SetStringValue(llvm::StringRef new_value) {
|
2012-08-23 01:17:09 +08:00
|
|
|
OptionValueString *option_value = GetAsString();
|
|
|
|
if (option_value) {
|
2016-09-24 02:06:53 +08:00
|
|
|
option_value->SetCurrentValue(new_value);
|
2012-08-23 01:17:09 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
uint64_t OptionValue::GetUInt64Value(uint64_t fail_value) const {
|
|
|
|
const OptionValueUInt64 *option_value = GetAsUInt64();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return fail_value;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::SetUInt64Value(uint64_t new_value) {
|
|
|
|
OptionValueUInt64 *option_value = GetAsUInt64();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(new_value);
|
|
|
|
return true;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-08-23 01:17:09 +08:00
|
|
|
return false;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
UUID OptionValue::GetUUIDValue() const {
|
|
|
|
const OptionValueUUID *option_value = GetAsUUID();
|
|
|
|
if (option_value)
|
|
|
|
return option_value->GetCurrentValue();
|
|
|
|
return UUID();
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
bool OptionValue::SetUUIDValue(const UUID &uuid) {
|
|
|
|
OptionValueUUID *option_value = GetAsUUID();
|
|
|
|
if (option_value) {
|
|
|
|
option_value->SetCurrentValue(uuid);
|
|
|
|
return true;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-08-23 01:17:09 +08:00
|
|
|
return false;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
const char *OptionValue::GetBuiltinTypeAsCString(Type t) {
|
|
|
|
switch (t) {
|
|
|
|
case eTypeInvalid:
|
|
|
|
return "invalid";
|
|
|
|
case eTypeArch:
|
|
|
|
return "arch";
|
|
|
|
case eTypeArgs:
|
|
|
|
return "arguments";
|
|
|
|
case eTypeArray:
|
|
|
|
return "array";
|
2015-02-05 06:00:53 +08:00
|
|
|
case eTypeBoolean:
|
2012-08-23 01:17:09 +08:00
|
|
|
return "boolean";
|
|
|
|
case eTypeChar:
|
|
|
|
return "char";
|
|
|
|
case eTypeDictionary:
|
|
|
|
return "dictionary";
|
|
|
|
case eTypeEnum:
|
|
|
|
return "enum";
|
2020-07-17 02:34:50 +08:00
|
|
|
case eTypeFileLineColumn:
|
|
|
|
return "file:line:column specifier";
|
2015-02-05 06:00:53 +08:00
|
|
|
case eTypeFileSpec:
|
2012-08-23 01:17:09 +08:00
|
|
|
return "file";
|
2015-02-05 06:00:53 +08:00
|
|
|
case eTypeFileSpecList:
|
2012-08-23 01:17:09 +08:00
|
|
|
return "file-list";
|
2015-02-05 06:00:53 +08:00
|
|
|
case eTypeFormat:
|
2012-08-23 01:17:09 +08:00
|
|
|
return "format";
|
|
|
|
case eTypeFormatEntity:
|
|
|
|
return "format-string";
|
|
|
|
case eTypeLanguage:
|
|
|
|
return "language";
|
|
|
|
case eTypePathMap:
|
|
|
|
return "path-map";
|
|
|
|
case eTypeProperties:
|
|
|
|
return "properties";
|
|
|
|
case eTypeRegex:
|
|
|
|
return "regex";
|
|
|
|
case eTypeSInt64:
|
|
|
|
return "int";
|
|
|
|
case eTypeString:
|
|
|
|
return "string";
|
|
|
|
case eTypeUInt64:
|
|
|
|
return "unsigned";
|
2015-02-05 06:00:53 +08:00
|
|
|
case eTypeUUID:
|
2012-08-23 01:17:09 +08:00
|
|
|
return "uuid";
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2014-04-20 08:31:37 +08:00
|
|
|
return nullptr;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
lldb::OptionValueSP OptionValue::CreateValueFromCStringForTypeMask(
|
2017-05-12 12:51:55 +08:00
|
|
|
const char *value_cstr, uint32_t type_mask, Status &error) {
|
2018-05-01 00:49:04 +08:00
|
|
|
// If only 1 bit is set in the type mask for a dictionary or array then we
|
|
|
|
// know how to decode a value from a cstring
|
2012-08-23 01:17:09 +08:00
|
|
|
lldb::OptionValueSP value_sp;
|
|
|
|
switch (type_mask) {
|
|
|
|
case 1u << eTypeArch:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueArch>();
|
2012-08-23 01:17:09 +08:00
|
|
|
break;
|
|
|
|
case 1u << eTypeBoolean:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueBoolean>(false);
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
2015-01-13 04:44:02 +08:00
|
|
|
case 1u << eTypeChar:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueChar>('\0');
|
2012-08-23 01:17:09 +08:00
|
|
|
break;
|
|
|
|
case 1u << eTypeFileSpec:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueFileSpec>();
|
2012-08-23 01:17:09 +08:00
|
|
|
break;
|
|
|
|
case 1u << eTypeFormat:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueFormat>(eFormatInvalid);
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
2015-02-05 06:00:53 +08:00
|
|
|
case 1u << eTypeFormatEntity:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueFormatEntity>(nullptr);
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
2015-02-21 03:46:30 +08:00
|
|
|
case 1u << eTypeLanguage:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueLanguage>(eLanguageTypeUnknown);
|
2012-08-23 01:17:09 +08:00
|
|
|
break;
|
|
|
|
case 1u << eTypeSInt64:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueSInt64>();
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
2012-08-23 01:17:09 +08:00
|
|
|
case 1u << eTypeString:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueString>();
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
2012-08-23 01:17:09 +08:00
|
|
|
case 1u << eTypeUInt64:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueUInt64>();
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
2012-08-23 01:17:09 +08:00
|
|
|
case 1u << eTypeUUID:
|
2020-06-20 02:17:00 +08:00
|
|
|
value_sp = std::make_shared<OptionValueUUID>();
|
2012-08-23 01:17:09 +08:00
|
|
|
break;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2012-08-23 01:17:09 +08:00
|
|
|
if (value_sp)
|
2021-05-18 15:03:28 +08:00
|
|
|
error = value_sp->SetValueFromString(value_cstr, eVarSetOperationAssign);
|
2016-09-07 04:57:50 +08:00
|
|
|
else
|
2012-08-23 01:17:09 +08:00
|
|
|
error.SetErrorString("unsupported type mask");
|
2015-02-05 06:00:53 +08:00
|
|
|
return value_sp;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
|
|
|
|
2015-02-05 06:00:53 +08:00
|
|
|
bool OptionValue::DumpQualifiedName(Stream &strm) const {
|
|
|
|
bool dumped_something = false;
|
|
|
|
lldb::OptionValueSP m_parent_sp(m_parent_wp.lock());
|
2012-08-23 01:17:09 +08:00
|
|
|
if (m_parent_sp) {
|
2015-02-20 19:14:59 +08:00
|
|
|
if (m_parent_sp->DumpQualifiedName(strm))
|
|
|
|
dumped_something = true;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2015-02-20 19:14:59 +08:00
|
|
|
ConstString name(GetName());
|
2012-08-23 01:17:09 +08:00
|
|
|
if (name) {
|
|
|
|
if (dumped_something)
|
|
|
|
strm.PutChar('.');
|
|
|
|
else
|
|
|
|
dumped_something = true;
|
|
|
|
strm << name;
|
2016-09-07 04:57:50 +08:00
|
|
|
}
|
2012-08-23 01:17:09 +08:00
|
|
|
return dumped_something;
|
|
|
|
}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2021-02-20 05:49:42 +08:00
|
|
|
OptionValueSP OptionValue::DeepCopy(const OptionValueSP &new_parent) const {
|
2021-03-02 01:14:15 +08:00
|
|
|
auto clone = Clone();
|
2021-02-20 05:49:42 +08:00
|
|
|
clone->SetParent(new_parent);
|
|
|
|
return clone;
|
|
|
|
}
|
|
|
|
|
[lldb][NFC] Remove WordComplete mode, make result array indexed from 0 and remove any undocumented/redundant return values
Summary:
We still have some leftovers of the old completion API in the internals of
LLDB that haven't been replaced by the new CompletionRequest. These leftovers
are:
* The return values (int/size_t) in all completion functions.
* Our result array that starts indexing at 1.
* `WordComplete` mode.
I didn't replace them back then because it's tricky to figure out what exactly they
are used for and the completion code is relatively untested. I finally got around
to writing more tests for the API and understanding the semantics, so I think it's
a good time to get rid of them.
A few words why those things should be removed/replaced:
* The return values are really cryptic, partly redundant and rarely documented.
They are also completely ignored by Xcode, so whatever information they contain will end up
breaking Xcode's completion mechanism. They are also partly impossible to even implement
as we assign negative values special meaning and our completion API sometimes returns size_t.
Completion functions are supposed to return -2 to rewrite the current line. We seem to use this
in some untested code path to expand the history repeat character to the full command, but
I haven't figured out why that doesn't work at the moment.
Completion functions return -1 to 'insert the completion character', but that isn't implemented
(even though we seem to activate this feature in LLDB sometimes).
All positive values have to match the number of results. This is obviously just redundant information
as the user can just look at the result list to get that information (which is what Xcode does).
* The result array that starts indexing at 1 is obviously unexpected. The first element of the array is
reserved for the common prefix of all completions (e.g. "foobar" and "footar" -> "foo"). The idea is
that we calculate this to make the life of the API caller easier, but obviously forcing people to have
1-based indices is not helpful (or even worse, forces them to manually copy the results to make it
0-based like Xcode has to do).
* The `WordComplete` mode indicates that LLDB should enter a space behind the completion. The
idea is that we let the top-level API know that we just provided a full completion. Interestingly we
`WordComplete` is just a single bool that somehow represents all N completions. And we always
provide full completions in LLDB, so in theory it should always be true.
The only use it currently serves is providing redundant information about whether we have a single
definitive completion or not (which we already know from the number of results we get).
This patch essentially removes `WordComplete` mode and makes the result array indexed from 0.
It also removes all return values from all internal completion functions. The only non-redundant information
they contain is about rewriting the current line (which is broken), so that functionality was moved
to the CompletionRequest API. So you can now do `addCompletion("blub", "description", CompletionMode::RewriteLine)`
to do the same.
For the SB API we emulate the old behaviour by making the array indexed from 1 again with the common
prefix at index 0. I didn't keep the special negative return codes as we either never sent them before (e.g. -2) or we
didn't even implement them in the Editline handler (e.g. -1).
I tried to keep this patch minimal and I'm aware we can probably now even further simplify a bunch of related code,
but I would prefer doing this in follow-up NFC commits
Reviewers: JDevlieghere
Reviewed By: JDevlieghere
Subscribers: arphaman, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D66536
llvm-svn: 369624
2019-08-22 15:41:23 +08:00
|
|
|
void OptionValue::AutoComplete(CommandInterpreter &interpreter,
|
|
|
|
CompletionRequest &request) {}
|
2016-09-07 04:57:50 +08:00
|
|
|
|
2017-05-12 12:51:55 +08:00
|
|
|
Status OptionValue::SetValueFromString(llvm::StringRef value,
|
|
|
|
VarSetOperationType op) {
|
|
|
|
Status error;
|
2012-08-23 01:17:09 +08:00
|
|
|
switch (op) {
|
|
|
|
case eVarSetOperationReplace:
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"%s objects do not support the 'replace' operation",
|
|
|
|
GetTypeAsCString());
|
2016-09-07 04:57:50 +08:00
|
|
|
break;
|
2015-02-20 19:14:59 +08:00
|
|
|
case eVarSetOperationInsertBefore:
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"%s objects do not support the 'insert-before' operation",
|
|
|
|
GetTypeAsCString());
|
2012-08-23 01:17:09 +08:00
|
|
|
break;
|
|
|
|
case eVarSetOperationInsertAfter:
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"%s objects do not support the 'insert-after' operation",
|
|
|
|
GetTypeAsCString());
|
|
|
|
break;
|
|
|
|
case eVarSetOperationRemove:
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"%s objects do not support the 'remove' operation", GetTypeAsCString());
|
|
|
|
break;
|
|
|
|
case eVarSetOperationAppend:
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"%s objects do not support the 'append' operation", GetTypeAsCString());
|
|
|
|
break;
|
|
|
|
case eVarSetOperationClear:
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"%s objects do not support the 'clear' operation", GetTypeAsCString());
|
|
|
|
break;
|
|
|
|
case eVarSetOperationAssign:
|
|
|
|
error.SetErrorStringWithFormat(
|
|
|
|
"%s objects do not support the 'assign' operation", GetTypeAsCString());
|
|
|
|
break;
|
|
|
|
case eVarSetOperationInvalid:
|
|
|
|
error.SetErrorStringWithFormat("invalid operation performed on a %s object",
|
|
|
|
GetTypeAsCString());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return error;
|
|
|
|
}
|