Skip to content

Commit 20d57e7

Browse files
[lldb][AIX] Added base file for AIX Register Context (#144645)
This PR is in reference to porting LLDB on AIX. Link to discussions on llvm discourse and github: 1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640 2. #101657 The complete changes for porting are present in this draft PR: #102601 - Added skeleton for Registercontext file for AIX. (Later we will add implementation respectively)
1 parent a2b8a93 commit 20d57e7

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
add_lldb_library(lldbPluginProcessAIX
22
NativeProcessAIX.cpp
33
NativeThreadAIX.cpp
4+
NativeRegisterContextAIX.cpp
45

56
LINK_COMPONENTS
67
Support
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
//===---- NativeRegisterContextAIX.cpp ------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#include "NativeRegisterContextAIX.h"
10+
#include "Plugins/Process/AIX/NativeProcessAIX.h"
11+
12+
using namespace lldb_private;
13+
using namespace lldb_private::process_aix;
14+
15+
lldb::ByteOrder NativeRegisterContextAIX::GetByteOrder() const {
16+
return lldb::eByteOrderInvalid;
17+
}
18+
19+
Status NativeRegisterContextAIX::ReadRegisterRaw(uint32_t reg_index,
20+
RegisterValue &reg_value) {
21+
return Status("unimplemented");
22+
}
23+
24+
Status
25+
NativeRegisterContextAIX::WriteRegisterRaw(uint32_t reg_index,
26+
const RegisterValue &reg_value) {
27+
return Status("unimplemented");
28+
}
29+
30+
Status NativeRegisterContextAIX::ReadGPR() { return Status("unimplemented"); }
31+
32+
Status NativeRegisterContextAIX::WriteGPR() { return Status("unimplemented"); }
33+
34+
Status NativeRegisterContextAIX::ReadFPR() { return Status("unimplemented"); }
35+
36+
Status NativeRegisterContextAIX::WriteFPR() { return Status("unimplemented"); }
37+
38+
Status NativeRegisterContextAIX::ReadVMX() { return Status("unimplemented"); }
39+
40+
Status NativeRegisterContextAIX::WriteVMX() { return Status("unimplemented"); }
41+
42+
Status NativeRegisterContextAIX::ReadVSX() { return Status("unimplemented"); }
43+
44+
Status NativeRegisterContextAIX::WriteVSX() { return Status("unimplemented"); }
45+
46+
Status NativeRegisterContextAIX::ReadRegisterSet(void *buf, size_t buf_size,
47+
unsigned int regset) {
48+
return Status("unimplemented");
49+
}
50+
51+
Status NativeRegisterContextAIX::WriteRegisterSet(void *buf, size_t buf_size,
52+
unsigned int regset) {
53+
return Status("unimplemented");
54+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//===---- NativeRegisterContextAIX.h ----------------------------*- C++ -*-===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_H
10+
#define LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_H
11+
12+
#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
13+
14+
namespace lldb_private::process_aix {
15+
16+
class NativeRegisterContextAIX
17+
: public virtual NativeRegisterContextRegisterInfo {
18+
protected:
19+
NativeRegisterContextAIX(NativeThreadProtocol &thread)
20+
: NativeRegisterContextRegisterInfo(thread, nullptr) {}
21+
22+
lldb::ByteOrder GetByteOrder() const;
23+
24+
virtual Status ReadRegisterRaw(uint32_t reg_index, RegisterValue &reg_value);
25+
26+
virtual Status WriteRegisterRaw(uint32_t reg_index,
27+
const RegisterValue &reg_value);
28+
29+
virtual Status ReadRegisterSet(void *buf, size_t buf_size,
30+
unsigned int regset);
31+
32+
virtual Status WriteRegisterSet(void *buf, size_t buf_size,
33+
unsigned int regset);
34+
35+
virtual Status ReadGPR();
36+
37+
virtual Status WriteGPR();
38+
39+
virtual Status ReadFPR();
40+
41+
virtual Status WriteFPR();
42+
43+
virtual Status ReadVMX();
44+
45+
virtual Status WriteVMX();
46+
47+
virtual Status ReadVSX();
48+
49+
virtual Status WriteVSX();
50+
51+
virtual void *GetGPRBuffer() = 0;
52+
53+
virtual size_t GetGPRSize() = 0;
54+
55+
virtual void *GetFPRBuffer() = 0;
56+
57+
virtual size_t GetFPRSize() = 0;
58+
};
59+
60+
} // namespace lldb_private::process_aix
61+
62+
#endif // #ifndef LLDB_SOURCE_PLUGINS_PROCESS_AIX_NATIVEREGISTERCONTEXTAIX_H

0 commit comments

Comments
 (0)