From d525a99be1b02dda6c69007e31dd06f276378aea Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 25 May 2018 12:39:51 -0600 Subject: Add "name" method to class interp In a review Pedro pointed out that interp::name is intended to be read-only, and so an accessor would be a better fit. This patch renames the field and adds a "name" method that is used instead. ChangeLog 2018-05-25 Tom Tromey * tui/tui.c (tui_enable): Update. * mi/mi-interp.c (mi_interp::init): Update. * interps.h (class interp) : New method. : Rename from name. (~scoped_restore_interp): Update. * interps.c (interp::interp): Update. (interp_add, interp_set, interp_lookup_existing) (current_interp_named_p): Update. --- gdb/interps.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gdb/interps.h') diff --git a/gdb/interps.h b/gdb/interps.h index a689be5..74c9a80 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -74,8 +74,13 @@ public: virtual bool supports_command_editing () { return false; } + const char *name () const + { + return m_name; + } + /* This is the name in "-i=" and "set interpreter". */ - const char *name; + const char *m_name; /* Interpreters are stored in a linked list, this is the next one... */ @@ -111,7 +116,7 @@ public: ~scoped_restore_interp () { - set_interp (m_interp->name); + set_interp (m_interp->name ()); } scoped_restore_interp (const scoped_restore_interp &) = delete; -- cgit v1.1