• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef PANDA_VERIFICATION_VERIFICATION_OPTIONS_H_
17 #define PANDA_VERIFICATION_VERIFICATION_OPTIONS_H_
18 
19 #include "utils/pandargs.h"
20 #include "runtime/include/runtime_options.h"
21 #include "runtime/include/mem/panda_containers.h"
22 #include "runtime/include/mem/panda_string.h"
23 #include "verification/cflow/cflow_check_options.h"
24 #include "verification/debug/options/method_options_config.h"
25 #include "verifier_messages.h"
26 
27 #include <string>
28 #include <unordered_map>
29 
30 namespace panda::verifier {
31 
32 struct VerificationOptions {
33     using MethodOptionsConfig =
34         VerifierMethodOptionsConfig<PandaString, VerifierMessage, PandaUnorderedMap, PandaVector>;
35     bool Enable = true;
36     struct {
37         bool Status = true;
38     } Show;
39     CflowCheckFlags Cflow;
40     struct {
41         bool OnlyBuildTypeSystem = false;
42         bool VerifyAllRuntimeLibraryMethods = false;
43         bool VerifyOnlyEntryPoint = false;
44         bool VerifierDoesNotFail = false;
45         bool OnlyVerify = false;
46         bool DebugEnable = true;
47         bool DoNotAssumeLibraryMethodsVerified = false;
48         bool SyncOnClassInitialization = false;
49         size_t VerificationThreads = 1;
50     } Mode;
51     struct {
52         std::string File;
53         bool UpdateOnExit = false;
54     } Cache;
55     struct {
56         std::string ConfigFile = "default";
57         struct {
58             bool RegChanges = false;
59             bool Context = false;
60             bool TypeSystem = false;
61         } Show;
62         struct {
63             bool UndefinedClass = false;
64             bool UndefinedMethod = false;
65             bool UndefinedField = false;
66             bool UndefinedType = false;
67             bool UndefinedString = false;
68             bool MethodAccessViolation = false;
69             bool ErrorInExceptionHandler = false;
70             bool PermanentRuntimeException = false;
71             bool FieldAccessViolation = false;
72             bool WrongSubclassingInMethodArgs = false;
73         } Allow;
74         MethodOptionsConfig *MethodOptions = nullptr;
GetMethodOptionsVerificationOptions::__anon31d9c3cc040875         MethodOptionsConfig &GetMethodOptions()
76         {
77             return *MethodOptions;
78         }
GetMethodOptionsVerificationOptions::__anon31d9c3cc040879         const MethodOptionsConfig &GetMethodOptions() const
80         {
81             return *MethodOptions;
82         }
83     } Debug;
84     void Initialize(const panda::RuntimeOptions &runtime_options);
85     void Destroy();
86 };
87 
88 }  // namespace panda::verifier
89 
90 #endif  // PANDA_VERIFICATION_VERIFICATION_OPTIONS_H_
91