public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb/testsuite: add simavr.exp board
Date: Mon, 25 May 2020 15:44:18 +0100	[thread overview]
Message-ID: <cc0be8c5-41b2-6c4f-6cf9-ae00cb00d105@redhat.com> (raw)
In-Reply-To: <25976d2f-2071-49cc-c503-7408e254d06b@polymtl.ca>

On 5/25/20 2:29 PM, Simon Marchi via Gdb-patches wrote:

> Ah, the issue wasn't really gdb_expect or the regex.
> 
> It's just that gdb_run_cmd expects gdb_reload to return 0 in order
> to proceed:
> 
>  268             if { [gdb_reload] != 0 } {
>  269                 return
>  270             }
> 
> And tcl has this common shell behavior where a procedure returns
> the same thing as the last thing it called, without an explicit
> "return":
> 
> $ cat test.tcl
> proc p1 {} {
>   return 17
> }
> 
> proc p2 {} {
>   p1
> }
> 
> puts [p2]
> $ tclsh test.tcl
> 17
> 

Yeah.

> And gdb_test_multiple just happened to return 0, but gdb_expect
> did not.  Using gdb_expect and adding a `return 0` in my proc
> made it work.
> 

Thanks for digging into it.

> Here's the patch with that fixed:

Don't you want to handle timeout (and maybe unexpected output) in
the new gdb_expect call?

Regardless, this LGTM.  It doesn't impact anything else and can always be
improved afterwards.

Thanks,
Pedro Alves


  reply	other threads:[~2020-05-25 14:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-24 14:20 Simon Marchi
2020-05-24 14:20 ` [PATCH 2/2] gdb: make avr_integer_to_address generate code or data address based on type Simon Marchi
2020-05-24 16:36   ` Pedro Alves
2020-05-24 16:33 ` [PATCH 1/2] gdb/testsuite: add simavr.exp board Pedro Alves
2020-05-25 13:29   ` Simon Marchi
2020-05-25 14:44     ` Pedro Alves [this message]
2020-05-25 15:57       ` Simon Marchi

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=cc0be8c5-41b2-6c4f-6cf9-ae00cb00d105@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).