aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-05-12 04:51:55 +0000
committerZachary Turner <zturner@google.com>2017-05-12 04:51:55 +0000
commit97206d572797bddc1bba71bb1c18c97f19d69053 (patch)
treefdf21d24485672cf97c800264d135b9d5d2ecdce /lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
parent3086b45a2fae833e8419885e78c598d936cc6429 (diff)
downloadllvm-97206d572797bddc1bba71bb1c18c97f19d69053.tar.gz
llvm-97206d572797bddc1bba71bb1c18c97f19d69053.tar.bz2
llvm-97206d572797bddc1bba71bb1c18c97f19d69053.zip
Rename Error -> Status.
This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp63
1 files changed, 32 insertions, 31 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
index be256e972215..43253f388019 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux.cpp
@@ -41,18 +41,19 @@ lldb::ByteOrder NativeRegisterContextLinux::GetByteOrder() const {
return byte_order;
}
-Error NativeRegisterContextLinux::ReadRegisterRaw(uint32_t reg_index,
- RegisterValue &reg_value) {
+Status NativeRegisterContextLinux::ReadRegisterRaw(uint32_t reg_index,
+ RegisterValue &reg_value) {
const RegisterInfo *const reg_info = GetRegisterInfoAtIndex(reg_index);
if (!reg_info)
- return Error("register %" PRIu32 " not found", reg_index);
+ return Status("register %" PRIu32 " not found", reg_index);
return DoReadRegisterValue(reg_info->byte_offset, reg_info->name,
reg_info->byte_size, reg_value);
}
-Error NativeRegisterContextLinux::WriteRegisterRaw(
- uint32_t reg_index, const RegisterValue &reg_value) {
+Status
+NativeRegisterContextLinux::WriteRegisterRaw(uint32_t reg_index,
+ const RegisterValue &reg_value) {
uint32_t reg_to_write = reg_index;
RegisterValue value_to_write = reg_value;
@@ -60,7 +61,7 @@ Error NativeRegisterContextLinux::WriteRegisterRaw(
const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg_index);
if (reg_info->invalidate_regs &&
(reg_info->invalidate_regs[0] != LLDB_INVALID_REGNUM)) {
- Error error;
+ Status error;
RegisterValue full_value;
uint32_t full_reg = reg_info->invalidate_regs[0];
@@ -99,71 +100,71 @@ Error NativeRegisterContextLinux::WriteRegisterRaw(
assert(register_to_write_info_p &&
"register to write does not have valid RegisterInfo");
if (!register_to_write_info_p)
- return Error("NativeRegisterContextLinux::%s failed to get RegisterInfo "
- "for write register index %" PRIu32,
- __FUNCTION__, reg_to_write);
+ return Status("NativeRegisterContextLinux::%s failed to get RegisterInfo "
+ "for write register index %" PRIu32,
+ __FUNCTION__, reg_to_write);
return DoWriteRegisterValue(reg_info->byte_offset, reg_info->name, reg_value);
}
-Error NativeRegisterContextLinux::ReadGPR() {
+Status NativeRegisterContextLinux::ReadGPR() {
void *buf = GetGPRBuffer();
if (!buf)
- return Error("GPR buffer is NULL");
+ return Status("GPR buffer is NULL");
size_t buf_size = GetGPRSize();
return DoReadGPR(buf, buf_size);
}
-Error NativeRegisterContextLinux::WriteGPR() {
+Status NativeRegisterContextLinux::WriteGPR() {
void *buf = GetGPRBuffer();
if (!buf)
- return Error("GPR buffer is NULL");
+ return Status("GPR buffer is NULL");
size_t buf_size = GetGPRSize();
return DoWriteGPR(buf, buf_size);
}
-Error NativeRegisterContextLinux::ReadFPR() {
+Status NativeRegisterContextLinux::ReadFPR() {
void *buf = GetFPRBuffer();
if (!buf)
- return Error("FPR buffer is NULL");
+ return Status("FPR buffer is NULL");
size_t buf_size = GetFPRSize();
return DoReadFPR(buf, buf_size);
}
-Error NativeRegisterContextLinux::WriteFPR() {
+Status NativeRegisterContextLinux::WriteFPR() {
void *buf = GetFPRBuffer();
if (!buf)
- return Error("FPR buffer is NULL");
+ return Status("FPR buffer is NULL");
size_t buf_size = GetFPRSize();
return DoWriteFPR(buf, buf_size);
}
-Error NativeRegisterContextLinux::ReadRegisterSet(void *buf, size_t buf_size,
- unsigned int regset) {
+Status NativeRegisterContextLinux::ReadRegisterSet(void *buf, size_t buf_size,
+ unsigned int regset) {
return NativeProcessLinux::PtraceWrapper(PTRACE_GETREGSET, m_thread.GetID(),
static_cast<void *>(&regset), buf,
buf_size);
}
-Error NativeRegisterContextLinux::WriteRegisterSet(void *buf, size_t buf_size,
- unsigned int regset) {
+Status NativeRegisterContextLinux::WriteRegisterSet(void *buf, size_t buf_size,
+ unsigned int regset) {
return NativeProcessLinux::PtraceWrapper(PTRACE_SETREGSET, m_thread.GetID(),
static_cast<void *>(&regset), buf,
buf_size);
}
-Error NativeRegisterContextLinux::DoReadRegisterValue(uint32_t offset,
- const char *reg_name,
- uint32_t size,
- RegisterValue &value) {
+Status NativeRegisterContextLinux::DoReadRegisterValue(uint32_t offset,
+ const char *reg_name,
+ uint32_t size,
+ RegisterValue &value) {
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_REGISTERS));
long data;
- Error error = NativeProcessLinux::PtraceWrapper(
+ Status error = NativeProcessLinux::PtraceWrapper(
PTRACE_PEEKUSER, m_thread.GetID(), reinterpret_cast<void *>(offset),
nullptr, 0, &data);
@@ -175,7 +176,7 @@ Error NativeRegisterContextLinux::DoReadRegisterValue(uint32_t offset,
return error;
}
-Error NativeRegisterContextLinux::DoWriteRegisterValue(
+Status NativeRegisterContextLinux::DoWriteRegisterValue(
uint32_t offset, const char *reg_name, const RegisterValue &value) {
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_REGISTERS));
@@ -186,22 +187,22 @@ Error NativeRegisterContextLinux::DoWriteRegisterValue(
PTRACE_POKEUSER, m_thread.GetID(), reinterpret_cast<void *>(offset), buf);
}
-Error NativeRegisterContextLinux::DoReadGPR(void *buf, size_t buf_size) {
+Status NativeRegisterContextLinux::DoReadGPR(void *buf, size_t buf_size) {
return NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(),
nullptr, buf, buf_size);
}
-Error NativeRegisterContextLinux::DoWriteGPR(void *buf, size_t buf_size) {
+Status NativeRegisterContextLinux::DoWriteGPR(void *buf, size_t buf_size) {
return NativeProcessLinux::PtraceWrapper(PTRACE_SETREGS, m_thread.GetID(),
nullptr, buf, buf_size);
}
-Error NativeRegisterContextLinux::DoReadFPR(void *buf, size_t buf_size) {
+Status NativeRegisterContextLinux::DoReadFPR(void *buf, size_t buf_size) {
return NativeProcessLinux::PtraceWrapper(PTRACE_GETFPREGS, m_thread.GetID(),
nullptr, buf, buf_size);
}
-Error NativeRegisterContextLinux::DoWriteFPR(void *buf, size_t buf_size) {
+Status NativeRegisterContextLinux::DoWriteFPR(void *buf, size_t buf_size) {
return NativeProcessLinux::PtraceWrapper(PTRACE_SETFPREGS, m_thread.GetID(),
nullptr, buf, buf_size);
}