Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/testsuite] Detect gdb prompt after monitor exit
Date: Tue, 15 Sep 2020 14:05:26 +0100	[thread overview]
Message-ID: <4c088e4f-0c8d-62da-215e-b7062296cb33@palves.net> (raw)
In-Reply-To: <20200914192152.GA18245@delia>

On 9/14/20 8:21 PM, Tom de Vries wrote:

> After issuing a "monitor exit" command, we should always get a prompt back, so
> check for that.
> 
> Tested on x86_64-linux.
> 
> Any comments?
> 

Good find.
> @@ -463,6 +465,15 @@ proc gdbserver_exit { is_mi } {
>                     warning "Timed out waiting for EOF in server after $monitor_exit"
>                 }
>  	    }
> +	    if { ! read_prompt } {
> +		expect {
> +		    -i "$gdb_spawn_id" -re "$gdb_prompt $" {
> +		    }
> +		    timeout {
> +			warning "Timed out waiting for prompt after $monitor_exit"
> +		    }
> +		}
> +	    }

So if we get the prompt first, we go back to waiting for the eof.
But if the eof is first, we currently don't continue waiting for
the prompt.  Do we really need this new block of code instead
of just putting:

    if {!$read_prompt} {
      exp_continue
    }

in the eof case?

Thanks,
Pedro Alves


  reply	other threads:[~2020-09-15 13:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 19:21 Tom de Vries
2020-09-15 13:05 ` Pedro Alves [this message]
2020-09-15 14:17   ` Tom de Vries
2020-09-16 10:59     ` Pedro Alves
2020-09-16 12:55       ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4c088e4f-0c8d-62da-215e-b7062296cb33@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox