Skip to content

Commit 214054f

Browse files
committed
[lldb] Move DynamicRegisterInfo to public Target library
Move DynamicRegisterInfo from the internal lldbPluginProcessUtility library to the public lldbTarget library. This is a prerequisite towards ABI plugin changes that are going to pass DynamicRegisterInfo parameters. Differential Revision: https://reviews.llvm.org/D110942
1 parent 3334b9d commit 214054f

File tree

12 files changed

+19
-21
lines changed

12 files changed

+19
-21
lines changed

lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.h renamed to lldb/include/lldb/Target/DynamicRegisterInfo.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_DYNAMICREGISTERINFO_H
10-
#define LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_DYNAMICREGISTERINFO_H
9+
#ifndef LLDB_TARGET_DYNAMICREGISTERINFO_H
10+
#define LLDB_TARGET_DYNAMICREGISTERINFO_H
1111

1212
#include <map>
1313
#include <vector>
@@ -16,6 +16,8 @@
1616
#include "lldb/Utility/StructuredData.h"
1717
#include "lldb/lldb-private.h"
1818

19+
namespace lldb_private {
20+
1921
class DynamicRegisterInfo {
2022
protected:
2123
DynamicRegisterInfo(DynamicRegisterInfo &) = default;
@@ -113,4 +115,6 @@ class DynamicRegisterInfo {
113115
bool m_is_reconfigurable = false;
114116
};
115117

116-
#endif // LLDB_SOURCE_PLUGINS_PROCESS_UTILITY_DYNAMICREGISTERINFO_H
118+
} // namespace lldb_private
119+
120+
#endif // LLDB_TARGET_DYNAMICREGISTERINFO_H

lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include "OperatingSystemPython.h"
1414

15-
#include "Plugins/Process/Utility/DynamicRegisterInfo.h"
1615
#include "Plugins/Process/Utility/RegisterContextDummy.h"
1716
#include "Plugins/Process/Utility/RegisterContextMemory.h"
1817
#include "Plugins/Process/Utility/ThreadMemory.h"

lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@
1313

1414
#if LLDB_ENABLE_PYTHON
1515

16+
#include "lldb/Target/DynamicRegisterInfo.h"
1617
#include "lldb/Target/OperatingSystem.h"
1718
#include "lldb/Utility/StructuredData.h"
1819

19-
class DynamicRegisterInfo;
20-
2120
namespace lldb_private {
2221
class ScriptInterpreter;
2322
}
@@ -72,14 +71,14 @@ class OperatingSystemPython : public lldb_private::OperatingSystem {
7271
lldb_private::ThreadList &old_thread_list,
7372
std::vector<bool> &core_used_map, bool *did_create_ptr);
7473

75-
DynamicRegisterInfo *GetDynamicRegisterInfo();
74+
lldb_private::DynamicRegisterInfo *GetDynamicRegisterInfo();
7675

7776
lldb::ValueObjectSP m_thread_list_valobj_sp;
78-
std::unique_ptr<DynamicRegisterInfo> m_register_info_up;
77+
std::unique_ptr<lldb_private::DynamicRegisterInfo> m_register_info_up;
7978
lldb_private::ScriptInterpreter *m_interpreter;
8079
lldb_private::StructuredData::ObjectSP m_python_object_sp;
8180
};
8281

83-
#endif
82+
#endif // LLDB_ENABLE_PYTHON
8483

8584
#endif // liblldb_OperatingSystemPython_h_

lldb/source/Plugins/Process/Utility/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
add_lldb_library(lldbPluginProcessUtility
22
AuxVector.cpp
3-
DynamicRegisterInfo.cpp
43
FreeBSDSignals.cpp
54
GDBRemoteSignals.cpp
65
HistoryThread.cpp

lldb/source/Plugins/Process/Utility/RegisterContextMemory.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include "RegisterContextMemory.h"
1010

11-
#include "DynamicRegisterInfo.h"
1211
#include "lldb/Target/Process.h"
1312
#include "lldb/Target/Thread.h"
1413
#include "lldb/Utility/DataBufferHeap.h"

lldb/source/Plugins/Process/Utility/RegisterContextMemory.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,16 @@
1111

1212
#include <vector>
1313

14+
#include "lldb/Target/DynamicRegisterInfo.h"
1415
#include "lldb/Target/RegisterContext.h"
1516
#include "lldb/Utility/DataExtractor.h"
1617
#include "lldb/lldb-private.h"
1718

18-
class DynamicRegisterInfo;
19-
2019
class RegisterContextMemory : public lldb_private::RegisterContext {
2120
public:
2221
RegisterContextMemory(lldb_private::Thread &thread,
2322
uint32_t concrete_frame_idx,
24-
DynamicRegisterInfo &reg_info,
23+
lldb_private::DynamicRegisterInfo &reg_info,
2524
lldb::addr_t reg_data_addr);
2625

2726
~RegisterContextMemory() override;
@@ -60,7 +59,7 @@ class RegisterContextMemory : public lldb_private::RegisterContext {
6059
protected:
6160
void SetAllRegisterValid(bool b);
6261

63-
DynamicRegisterInfo &m_reg_infos;
62+
lldb_private::DynamicRegisterInfo &m_reg_infos;
6463
std::vector<bool> m_reg_valid;
6564
lldb_private::DataExtractor m_reg_data;
6665
lldb::addr_t m_reg_data_addr; // If this is valid, then we have a register

lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <vector>
1313

14-
#include "Plugins/Process/Utility/DynamicRegisterInfo.h"
14+
#include "lldb/Target/DynamicRegisterInfo.h"
1515
#include "lldb/Target/RegisterContext.h"
1616
#include "lldb/Utility/ConstString.h"
1717
#include "lldb/Utility/DataExtractor.h"

lldb/source/Target/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ lldb_tablegen(TargetPropertiesEnum.inc -gen-lldb-property-enum-defs
99
add_lldb_library(lldbTarget
1010
ABI.cpp
1111
AssertFrameRecognizer.cpp
12+
DynamicRegisterInfo.cpp
1213
ExecutionContext.cpp
1314
InstrumentationRuntime.cpp
1415
InstrumentationRuntimeStopInfo.cpp

lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp renamed to lldb/source/Target/DynamicRegisterInfo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "DynamicRegisterInfo.h"
10-
9+
#include "lldb/Target/DynamicRegisterInfo.h"
1110
#include "lldb/Core/StreamFile.h"
1211
#include "lldb/DataFormatters/FormatManager.h"
1312
#include "lldb/Interpreter/OptionArgParser.h"

lldb/unittests/Process/Utility/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ set(LLVM_OPTIONAL_SOURCES
1515
${NETBSD_SOURCES})
1616

1717
add_lldb_unittest(ProcessUtilityTests
18-
DynamicRegisterInfoTest.cpp
1918
LinuxProcMapsTest.cpp
2019
MemoryTagManagerAArch64MTETest.cpp
2120
RegisterContextTest.cpp

lldb/unittests/Target/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
add_lldb_unittest(TargetTests
22
ABITest.cpp
3+
DynamicRegisterInfoTest.cpp
34
ExecutionContextTest.cpp
45
MemoryRegionInfoTest.cpp
56
ModuleCacheTest.cpp

lldb/unittests/Process/Utility/DynamicRegisterInfoTest.cpp renamed to lldb/unittests/Target/DynamicRegisterInfoTest.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
#include "gmock/gmock.h"
1010
#include "gtest/gtest.h"
1111

12-
#include "Plugins/Process/Utility/DynamicRegisterInfo.h"
13-
12+
#include "lldb/Target/DynamicRegisterInfo.h"
1413
#include "lldb/Utility/ArchSpec.h"
1514

1615
using namespace lldb_private;

0 commit comments

Comments
 (0)