diff options
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -754,6 +754,21 @@ static char *gdb_readline_wrapper_result; return. */ static void (*saved_after_char_processing_hook) (void); + +/* The number of nested readline secondary prompts that are currently + active. */ + +static int gdb_secondary_prompt_depth = 0; + +/* See top.h. */ + +int +gdb_in_secondary_prompt_p (void) +{ + return gdb_secondary_prompt_depth > 0; +} + + /* This function is called when readline has seen a complete line of text. */ @@ -808,6 +823,8 @@ gdb_readline_wrapper_cleanup (void *arg) gdb_readline_wrapper_result = NULL; gdb_readline_wrapper_done = 0; + gdb_secondary_prompt_depth--; + gdb_assert (gdb_secondary_prompt_depth >= 0); after_char_processing_hook = saved_after_char_processing_hook; saved_after_char_processing_hook = NULL; @@ -833,6 +850,7 @@ gdb_readline_wrapper (const char *prompt) cleanup->target_is_async_orig = target_is_async_p (); + gdb_secondary_prompt_depth++; back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup); if (cleanup->target_is_async_orig) |