This revision was automatically updated to reflect the committed changes.
Closed by commit rL319939: Fix const-correctness in RegisterContext methods, 
NFC (authored by vedantk).

Changed prior to commit:
  https://reviews.llvm.org/D40821?vs=125639&id=125774#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40821

Files:
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
  lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp

Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_i386.cpp
@@ -43,17 +43,23 @@
 
 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
Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_arm.cpp
@@ -50,22 +50,30 @@
 
 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
Index: lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
+++ lldb/trunk/source/Plugins/Process/Utility/RegisterContextMach_x86_64.cpp
@@ -46,17 +46,23 @@
 
 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
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to