From 8a3ecb79b031d578cbdbac5e70784c157ff6387d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 28 Sep 2020 19:38:25 -0600 Subject: Turn target_can_lock_scheduler into a function This changes the object-like macro target_can_lock_scheduler into an inline function. gdb/ChangeLog 2020-09-28 Tom Tromey * infrun.c (set_schedlock_func): Update. * target.h (target_can_lock_scheduler): Now a function. --- gdb/ChangeLog | 5 +++++ gdb/infrun.c | 2 +- gdb/target.h | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2c29fff3..fb533ae 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2020-09-28 Tom Tromey + * infrun.c (set_schedlock_func): Update. + * target.h (target_can_lock_scheduler): Now a function. + +2020-09-28 Tom Tromey + * inferior.h (class inferior) : Update. * windows-tdep.c (windows_solib_create_inferior_hook): Update. * valops.c (find_function_in_inferior) diff --git a/gdb/infrun.c b/gdb/infrun.c index 6ff362c..17b406d 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2099,7 +2099,7 @@ show_scheduler_mode (struct ui_file *file, int from_tty, static void set_schedlock_func (const char *args, int from_tty, struct cmd_list_element *c) { - if (!target_can_lock_scheduler) + if (!target_can_lock_scheduler ()) { scheduler_mode = schedlock_off; error (_("Target '%s' cannot support this command."), target_shortname); diff --git a/gdb/target.h b/gdb/target.h index 20e7ae3..9ebb0c3 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -1837,8 +1837,12 @@ extern bool target_has_execution (inferior *inf = nullptr); /* Can the target support the debugger control of thread execution? Can it lock the thread scheduler? */ -#define target_can_lock_scheduler \ - (current_top_target ()->get_thread_control_capabilities () & tc_schedlock) +static inline bool +target_can_lock_scheduler () +{ + return (current_top_target ()->get_thread_control_capabilities () + & tc_schedlock) != 0; +} /* Controls whether async mode is permitted. */ extern bool target_async_permitted; -- cgit v1.1