aboutsummaryrefslogtreecommitdiff
path: root/gdb/interps.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-25 12:39:51 -0600
committerTom Tromey <tom@tromey.com>2018-05-25 12:41:02 -0600
commitd525a99be1b02dda6c69007e31dd06f276378aea (patch)
tree1fc7017164c71811abc89b028e2fb99d87f8a33a /gdb/interps.h
parentda505cff6e29b18244dc9f6886bcb4d436263dee (diff)
downloadgdb-d525a99be1b02dda6c69007e31dd06f276378aea.zip
gdb-d525a99be1b02dda6c69007e31dd06f276378aea.tar.gz
gdb-d525a99be1b02dda6c69007e31dd06f276378aea.tar.bz2
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 <tom@tromey.com> * tui/tui.c (tui_enable): Update. * mi/mi-interp.c (mi_interp::init): Update. * interps.h (class interp) <name>: New method. <m_name>: Rename from name. (~scoped_restore_interp): Update. * interps.c (interp::interp): Update. (interp_add, interp_set, interp_lookup_existing) (current_interp_named_p): Update.
Diffstat (limited to 'gdb/interps.h')
-rw-r--r--gdb/interps.h9
1 files changed, 7 insertions, 2 deletions
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;