diff options
author | Nick Roberts <nickrob@snap.net.nz> | 2008-04-19 06:08:18 +0000 |
---|---|---|
committer | Nick Roberts <nickrob@snap.net.nz> | 2008-04-19 06:08:18 +0000 |
commit | eb18d289abbeb32bf7ac6cb7c2a7b56232d7f718 (patch) | |
tree | 8d16ccbbe39da6416c107e32365a7c9f6fd0831c /gdb/interps.c | |
parent | bcbf8b680dffacef49f727b9c6c40ec4048d2afa (diff) | |
download | gdb-eb18d289abbeb32bf7ac6cb7c2a7b56232d7f718.zip gdb-eb18d289abbeb32bf7ac6cb7c2a7b56232d7f718.tar.gz gdb-eb18d289abbeb32bf7ac6cb7c2a7b56232d7f718.tar.bz2 |
(top_level_interpreter): Rename static variable...
(top_level_interpreter_ptr): ...to this.
(top_level_interpreter): New function.
Diffstat (limited to 'gdb/interps.c')
-rw-r--r-- | gdb/interps.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/interps.c b/gdb/interps.c index 7f48ef8..b4c804a 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -81,7 +81,7 @@ void _initialize_interpreter (void); static struct interp *interp_list = NULL; static struct interp *current_interpreter = NULL; -static struct interp *top_level_interpreter = NULL; +static struct interp *top_level_interpreter_ptr = NULL; static int interpreter_initialized = 0; @@ -144,7 +144,7 @@ interp_set (struct interp *interp, int top_level) /* If we already have an interpreter, then trying to set top level interpreter is kinda pointless. */ gdb_assert (!top_level || !current_interpreter); - gdb_assert (!top_level || !top_level_interpreter); + gdb_assert (!top_level || !top_level_interpreter_ptr); if (current_interpreter != NULL) { @@ -165,7 +165,7 @@ interp_set (struct interp *interp, int top_level) current_interpreter = interp; if (top_level) - top_level_interpreter = interp; + top_level_interpreter_ptr = interp; /* We use interpreter_p for the "set interpreter" variable, so we need to make sure we have a malloc'ed copy for the set command to free. */ @@ -476,11 +476,17 @@ interpreter_completer (char *text, char *word) return matches; } -extern void * +struct interp * +top_level_interpreter (void) +{ + return top_level_interpreter_ptr; +} + +void * top_level_interpreter_data (void) { - gdb_assert (top_level_interpreter); - return top_level_interpreter->data; + gdb_assert (top_level_interpreter_ptr); + return top_level_interpreter_ptr->data; } /* This just adds the "interpreter-exec" command. */ |