From: Nick Roberts Date: Sat, 19 Apr 2008 06:08:18 +0000 (+0000) Subject: (top_level_interpreter): Rename static variable... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eb18d289abbeb32bf7ac6cb7c2a7b56232d7f718;p=binutils-gdb.git (top_level_interpreter): Rename static variable... (top_level_interpreter_ptr): ...to this. (top_level_interpreter): New function. --- diff --git a/gdb/interps.c b/gdb/interps.c index 7f48ef82332..b4c804afd02 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. */