forked from OSchip/llvm-project
Fix const-correctness in RegisterContext methods, NFC
A few methods in RegisterContext classes accept const objects which are cast to a non-const thread_state_t. Drop const-ness more explicitly where we mean to do so. This fixes a slew of warnings. Differential Revision: https://reviews.llvm.org/D40821 llvm-svn: 319939
This commit is contained in:
parent
eacb0929e8
commit
94d788fa78
|
@ -50,22 +50,30 @@ int RegisterContextMach_arm::DoReadDBG(lldb::tid_t tid, int flavor, DBG &dbg) {
|
|||
|
||||
int RegisterContextMach_arm::DoWriteGPR(lldb::tid_t tid, int flavor,
|
||||
const GPR &gpr) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<GPR *>(&gpr)),
|
||||
GPRWordCount);
|
||||
}
|
||||
|
||||
int RegisterContextMach_arm::DoWriteFPU(lldb::tid_t tid, int flavor,
|
||||
const FPU &fpu) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<FPU *>(&fpu)),
|
||||
FPUWordCount);
|
||||
}
|
||||
|
||||
int RegisterContextMach_arm::DoWriteEXC(lldb::tid_t tid, int flavor,
|
||||
const EXC &exc) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<EXC *>(&exc)),
|
||||
EXCWordCount);
|
||||
}
|
||||
|
||||
int RegisterContextMach_arm::DoWriteDBG(lldb::tid_t tid, int flavor,
|
||||
const DBG &dbg) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&dbg, DBGWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<DBG *>(&dbg)),
|
||||
DBGWordCount);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -43,17 +43,23 @@ int RegisterContextMach_i386::DoReadEXC(lldb::tid_t tid, int flavor, EXC &exc) {
|
|||
|
||||
int RegisterContextMach_i386::DoWriteGPR(lldb::tid_t tid, int flavor,
|
||||
const GPR &gpr) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<GPR *>(&gpr)),
|
||||
GPRWordCount);
|
||||
}
|
||||
|
||||
int RegisterContextMach_i386::DoWriteFPU(lldb::tid_t tid, int flavor,
|
||||
const FPU &fpu) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<FPU *>(&fpu)),
|
||||
FPUWordCount);
|
||||
}
|
||||
|
||||
int RegisterContextMach_i386::DoWriteEXC(lldb::tid_t tid, int flavor,
|
||||
const EXC &exc) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<EXC *>(&exc)),
|
||||
EXCWordCount);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -46,17 +46,23 @@ int RegisterContextMach_x86_64::DoReadEXC(lldb::tid_t tid, int flavor,
|
|||
|
||||
int RegisterContextMach_x86_64::DoWriteGPR(lldb::tid_t tid, int flavor,
|
||||
const GPR &gpr) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&gpr, GPRWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<GPR *>(&gpr)),
|
||||
GPRWordCount);
|
||||
}
|
||||
|
||||
int RegisterContextMach_x86_64::DoWriteFPU(lldb::tid_t tid, int flavor,
|
||||
const FPU &fpu) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&fpu, FPUWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<FPU *>(&fpu)),
|
||||
FPUWordCount);
|
||||
}
|
||||
|
||||
int RegisterContextMach_x86_64::DoWriteEXC(lldb::tid_t tid, int flavor,
|
||||
const EXC &exc) {
|
||||
return ::thread_set_state(tid, flavor, (thread_state_t)&exc, EXCWordCount);
|
||||
return ::thread_set_state(
|
||||
tid, flavor, reinterpret_cast<thread_state_t>(const_cast<EXC *>(&exc)),
|
||||
EXCWordCount);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue