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  <tom@tromey.com>

	* infrun.c (set_schedlock_func): Update.
	* target.h (target_can_lock_scheduler): Now a function.
This commit is contained in:
Tom Tromey 2020-09-28 19:38:25 -06:00
parent 55f6301ac0
commit 8a3ecb79b0
3 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2020-09-28 Tom Tromey <tom@tromey.com>
* infrun.c (set_schedlock_func): Update.
* target.h (target_can_lock_scheduler): Now a function.
2020-09-28 Tom Tromey <tom@tromey.com>
* inferior.h (class inferior) <has_execution>: Update.

View File

@ -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);

View File

@ -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;