diff options
Diffstat (limited to 'gdb/command.h')
-rw-r--r-- | gdb/command.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/command.h b/gdb/command.h index f7a193334f6..dc662c87e54 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -420,12 +420,14 @@ struct base_setting The var_type of the setting must match T. */ template<typename T> - void set (T v) + bool set (T v) { /* Check that the current instance is of one of the supported types for this instantiation. */ gdb_assert (var_type_uses<T> (this->m_var_type)); + const T old_value = this->get<T> (); + auto setter = get_setting_setter<T> (this->m_setter); if (setter != nullptr) @@ -435,6 +437,8 @@ struct base_setting gdb_assert (this->m_var != nullptr); *static_cast<T *> (this->m_var) = v; } + + return old_value != this->get<T> (); } /* Set the user provided setter and getter functions. */ |