[2/4] gdbserver: make get_thread_lwp a function

Message ID 20241204163101.2294833-3-simark@simark.ca
State New
Headers
Series Some (hopefully) harmless cleanups |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Simon Marchi Dec. 4, 2024, 4:30 p.m. UTC
  From: Simon Marchi <simon.marchi@polymtl.ca>

Replace the macro with a static inline function.

Change-Id: I1cccf5b38d6a412d251763f0316902b07cc28d16
---
 gdbserver/linux-low.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h
index 66f72e94f28a..9a25697a90bc 100644
--- a/gdbserver/linux-low.h
+++ b/gdbserver/linux-low.h
@@ -712,7 +712,11 @@  class linux_process_target : public process_stratum_target
 
 extern linux_process_target *the_linux_target;
 
-#define get_thread_lwp(thr) ((struct lwp_info *) (thread_target_data (thr)))
+static inline lwp_info *
+get_thread_lwp (thread_info *thr)
+{
+  return static_cast<lwp_info *> (thread_target_data (thr));
+}
 
 /* Information about a signal that is to be delivered to a thread.  */