Skip to content

Commit eb7eee2

Browse files
committed
[lldb/Utility] Fix layering violation caused by ScriptedMetadata
This patch moves `ScriptedMetadata.h` from the `Interpreter` directory to the `Utility` sub-directory since `ProcessInfo.h` depends on it. It also gets rid of the unused `OptionGroupPythonClassWithDict` constructor for `ScriptedMetadata` which would address the layering violation. Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 320e17c commit eb7eee2

File tree

8 files changed

+7
-15
lines changed

8 files changed

+7
-15
lines changed

lldb/include/lldb/Interpreter/ScriptedMetadata.h renamed to lldb/include/lldb/Utility/ScriptedMetadata.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#ifndef LLDB_INTERPRETER_SCRIPTEDMETADATA_H
1010
#define LLDB_INTERPRETER_SCRIPTEDMETADATA_H
1111

12-
#include "OptionGroupPythonClassWithDict.h"
13-
1412
#include "lldb/Host/Host.h"
1513
#include "lldb/Utility/ProcessInfo.h"
1614
#include "lldb/Utility/StructuredData.h"
@@ -30,12 +28,6 @@ class ScriptedMetadata {
3028
}
3129
}
3230

33-
ScriptedMetadata(const OptionGroupPythonClassWithDict &option_group) {
34-
auto opt_group = const_cast<OptionGroupPythonClassWithDict &>(option_group);
35-
m_class_name = opt_group.GetName();
36-
m_args_sp = opt_group.GetStructuredData();
37-
}
38-
3931
explicit operator bool() const { return !m_class_name.empty(); }
4032

4133
llvm::StringRef GetClassName() const { return m_class_name; }

lldb/source/API/SBAttachInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
#include "lldb/API/SBFileSpec.h"
1212
#include "lldb/API/SBListener.h"
1313
#include "lldb/API/SBStructuredData.h"
14-
#include "lldb/Interpreter/ScriptedMetadata.h"
1514
#include "lldb/Target/Process.h"
1615
#include "lldb/Utility/Instrumentation.h"
16+
#include "lldb/Utility/ScriptedMetadata.h"
1717

1818
using namespace lldb;
1919
using namespace lldb_private;

lldb/source/API/SBLaunchInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "lldb/API/SBStructuredData.h"
1818
#include "lldb/Core/StructuredDataImpl.h"
1919
#include "lldb/Host/ProcessLaunchInfo.h"
20-
#include "lldb/Interpreter/ScriptedMetadata.h"
20+
#include "lldb/Utility/ScriptedMetadata.h"
2121

2222
using namespace lldb;
2323
using namespace lldb_private;

lldb/source/Commands/CommandObjectPlatform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#include "lldb/Interpreter/OptionGroupFile.h"
2121
#include "lldb/Interpreter/OptionGroupPlatform.h"
2222
#include "lldb/Interpreter/OptionGroupPythonClassWithDict.h"
23-
#include "lldb/Interpreter/ScriptedMetadata.h"
2423
#include "lldb/Target/ExecutionContext.h"
2524
#include "lldb/Target/Platform.h"
2625
#include "lldb/Target/Process.h"
2726
#include "lldb/Utility/Args.h"
27+
#include "lldb/Utility/ScriptedMetadata.h"
2828

2929
#include "llvm/ADT/SmallString.h"
3030

lldb/source/Commands/CommandObjectProcess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@
2525
#include "lldb/Interpreter/OptionArgParser.h"
2626
#include "lldb/Interpreter/OptionGroupPythonClassWithDict.h"
2727
#include "lldb/Interpreter/Options.h"
28-
#include "lldb/Interpreter/ScriptedMetadata.h"
2928
#include "lldb/Target/Platform.h"
3029
#include "lldb/Target/Process.h"
3130
#include "lldb/Target/StopInfo.h"
3231
#include "lldb/Target/Target.h"
3332
#include "lldb/Target/Thread.h"
3433
#include "lldb/Target/UnixSignals.h"
3534
#include "lldb/Utility/Args.h"
35+
#include "lldb/Utility/ScriptedMetadata.h"
3636
#include "lldb/Utility/State.h"
3737

3838
#include "llvm/ADT/ScopeExit.h"

lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
#include "lldb/Interpreter/OptionArgParser.h"
1919
#include "lldb/Interpreter/OptionGroupBoolean.h"
2020
#include "lldb/Interpreter/ScriptInterpreter.h"
21-
#include "lldb/Interpreter/ScriptedMetadata.h"
2221
#include "lldb/Target/MemoryRegionInfo.h"
2322
#include "lldb/Target/Queue.h"
2423
#include "lldb/Target/RegisterContext.h"
2524
#include "lldb/Utility/LLDBLog.h"
25+
#include "lldb/Utility/ScriptedMetadata.h"
2626
#include "lldb/Utility/State.h"
2727

2828
#include <mutex>

lldb/source/Plugins/Process/scripted/ScriptedProcess.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
#ifndef LLDB_SOURCE_PLUGINS_SCRIPTED_PROCESS_H
1010
#define LLDB_SOURCE_PLUGINS_SCRIPTED_PROCESS_H
1111

12-
#include "lldb/Interpreter/ScriptedMetadata.h"
1312
#include "lldb/Target/Process.h"
1413
#include "lldb/Utility/ConstString.h"
14+
#include "lldb/Utility/ScriptedMetadata.h"
1515
#include "lldb/Utility/Status.h"
1616

1717
#include "ScriptedThread.h"

lldb/source/Utility/ProcessInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "lldb/Utility/ProcessInfo.h"
1010

11-
#include "lldb/Interpreter/ScriptedMetadata.h"
1211
#include "lldb/Utility/ArchSpec.h"
12+
#include "lldb/Utility/ScriptedMetadata.h"
1313
#include "lldb/Utility/Stream.h"
1414
#include "lldb/Utility/StreamString.h"
1515
#include "lldb/Utility/UserIDResolver.h"

0 commit comments

Comments
 (0)