diff options
author | Pedro Alves <palves@redhat.com> | 2016-06-21 01:11:51 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2016-06-21 01:11:51 +0100 |
commit | dbf30ca3f5fec91671b37592f1a6644a2c36f67a (patch) | |
tree | 73f8bfedce01e0127c2f7794eacc6d24943d9304 /gdb/top.c | |
parent | b2d86570b316c347384c4ba9bb3933ed5e807fca (diff) | |
download | gdb-dbf30ca3f5fec91671b37592f1a6644a2c36f67a.zip gdb-dbf30ca3f5fec91671b37592f1a6644a2c36f67a.tar.gz gdb-dbf30ca3f5fec91671b37592f1a6644a2c36f67a.tar.bz2 |
Make gdb_in_secondary_prompt_p() be per UI
gdb/ChangeLog:
2016-06-21 Pedro Alves <palves@redhat.com>
* top.c (gdb_secondary_prompt_depth): Delete.
(gdb_in_secondary_prompt_p): Add ui parameter. Use it.
(gdb_readline_wrapper_cleanup, gdb_readline_wrapper): Adjust to
per-UI gdb_secondary_prompt_depth.
* top.h (struct ui) <secondary_prompt_depth>: New field.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -757,17 +757,12 @@ static char *gdb_readline_wrapper_result; 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) +gdb_in_secondary_prompt_p (struct ui *ui) { - return gdb_secondary_prompt_depth > 0; + return ui->secondary_prompt_depth > 0; } @@ -828,8 +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); + ui->secondary_prompt_depth--; + gdb_assert (ui->secondary_prompt_depth >= 0); after_char_processing_hook = saved_after_char_processing_hook; saved_after_char_processing_hook = NULL; @@ -859,7 +854,7 @@ gdb_readline_wrapper (const char *prompt) cleanup->target_is_async_orig = target_is_async_p (); - gdb_secondary_prompt_depth++; + ui->secondary_prompt_depth++; back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup); if (cleanup->target_is_async_orig) |