mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-05 17:08:17 +00:00
NativeProcessLinux: Fix some compiler warnings
llvm-svn: 307636
This commit is contained in:
parent
d7901b29ce
commit
993f2a4299
@ -680,7 +680,7 @@ Status NativeRegisterContextLinux_arm64::ClearAllHardwareWatchpoints() {
|
||||
return error;
|
||||
|
||||
lldb::addr_t tempAddr = 0;
|
||||
uint32_t tempControl = 0, tempRefCount = 0;
|
||||
uint32_t tempControl = 0;
|
||||
|
||||
for (uint32_t i = 0; i < m_max_hwp_supported; i++) {
|
||||
if (m_hwp_regs[i].control & 0x01) {
|
||||
@ -858,7 +858,7 @@ Status NativeRegisterContextLinux_arm64::DoReadRegisterValue(
|
||||
RegisterValue &value) {
|
||||
Status error;
|
||||
if (offset > sizeof(struct user_pt_regs)) {
|
||||
uintptr_t offset = offset - sizeof(struct user_pt_regs);
|
||||
offset -= sizeof(struct user_pt_regs);
|
||||
if (offset > sizeof(struct user_fpsimd_state)) {
|
||||
error.SetErrorString("invalid offset value");
|
||||
return error;
|
||||
@ -905,7 +905,7 @@ Status NativeRegisterContextLinux_arm64::DoWriteRegisterValue(
|
||||
Status error;
|
||||
::pid_t tid = m_thread.GetID();
|
||||
if (offset > sizeof(struct user_pt_regs)) {
|
||||
uintptr_t offset = offset - sizeof(struct user_pt_regs);
|
||||
offset -= sizeof(struct user_pt_regs);
|
||||
if (offset > sizeof(struct user_fpsimd_state)) {
|
||||
error.SetErrorString("invalid offset value");
|
||||
return error;
|
||||
|
@ -646,13 +646,6 @@ Status NativeRegisterContextLinux_x86_64::ReadAllRegisterValues(
|
||||
Status error;
|
||||
|
||||
data_sp.reset(new DataBufferHeap(REG_CONTEXT_SIZE, 0));
|
||||
if (!data_sp) {
|
||||
error.SetErrorStringWithFormat(
|
||||
"failed to allocate DataBufferHeap instance of size %" PRIu64,
|
||||
REG_CONTEXT_SIZE);
|
||||
return error;
|
||||
}
|
||||
|
||||
error = ReadGPR();
|
||||
if (error.Fail())
|
||||
return error;
|
||||
@ -662,13 +655,6 @@ Status NativeRegisterContextLinux_x86_64::ReadAllRegisterValues(
|
||||
return error;
|
||||
|
||||
uint8_t *dst = data_sp->GetBytes();
|
||||
if (dst == nullptr) {
|
||||
error.SetErrorStringWithFormat("DataBufferHeap instance of size %" PRIu64
|
||||
" returned a null pointer",
|
||||
REG_CONTEXT_SIZE);
|
||||
return error;
|
||||
}
|
||||
|
||||
::memcpy(dst, &m_gpr_x86_64, GetRegisterInfoInterface().GetGPRSize());
|
||||
dst += GetRegisterInfoInterface().GetGPRSize();
|
||||
if (m_xstate_type == XStateType::FXSAVE)
|
||||
@ -741,10 +727,9 @@ Status NativeRegisterContextLinux_x86_64::WriteAllRegisterValues(
|
||||
}
|
||||
|
||||
if (data_sp->GetByteSize() != REG_CONTEXT_SIZE) {
|
||||
error.SetErrorStringWithFormat(
|
||||
"NativeRegisterContextLinux_x86_64::%s data_sp contained mismatched "
|
||||
"data size, expected %" PRIu64 ", actual %" PRIu64,
|
||||
__FUNCTION__, REG_CONTEXT_SIZE, data_sp->GetByteSize());
|
||||
error.SetErrorStringWithFormatv(
|
||||
"data_sp contained mismatched data size, expected {0}, actual {1}",
|
||||
REG_CONTEXT_SIZE, data_sp->GetByteSize());
|
||||
return error;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user