Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Cc: "Maciej W. Rozycki" <macro@codesourcery.com>,
	       Stan Shebs <stan@codesourcery.com>
Subject: Re: [PATCH] gdb.mi/mi-info-os.exp: Fix cross-debugger testing
Date: Thu, 09 Jan 2014 20:53:00 -0000	[thread overview]
Message-ID: <52CF08E6.5060202@redhat.com> (raw)
In-Reply-To: <528DF050.7040706@redhat.com>

Hi guys,

Going through my local git branches I found this
one almost forgotten.  FYI, I went ahead and pushed
it in.

-- 
Pedro Alves

On 11/21/2013 11:36 AM, Pedro Alves wrote:

> But, WDYT of this alternative below?  We don't want to
> unconditionally use mi_run_to_main, as then with native targets
> we'd lose the testing of -info-os before the program is running.
> But we can do what mi_run_to_main ends up using to connect
> to the target instead (mi_gdb_target_load).
> 
> ---
> gdb.mi/mi-info-os.exp: Fix cross-debugger testing
> 
> A live target is required for `-info-os' to work in non-native
> configurations.
> 
>  (gdb)
>  Expecting: ^(-info-os[
>  ]+)?(.*\^done,OSDataTable=.*[
>  ]+[(]gdb[)]
>  [ ]*)
> - info-os
>  ^error,msg="Don't know how to get OS data.  Try \"help target\"."
>  (gdb)
>  FAIL: gdb.mi/mi-info-os.exp: -info-os
> 
> If GDB does have a native configuration included, but we're testing
> remote, it'll be worse, as if we're not connected yet, -info-os will
> run against the default run target, and pass, falsely giving the
> impression the remote bits were exercised.
> 
> gdb/testsuite/
> 2013-11-21  Maciej W. Rozycki  <macro@codesourcery.com>
> 	    Pedro Alves  <palves@redhat.com>
> 
> 	* gdb.mi/mi-info-os.exp: Connect to the target with
>         mi_gdb_target_load.
> ---
> 
>  gdb/testsuite/gdb.mi/mi-info-os.exp |   20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/gdb/testsuite/gdb.mi/mi-info-os.exp b/gdb/testsuite/gdb.mi/mi-info-os.exp
> index d410cfb..f062510 100644
> --- a/gdb/testsuite/gdb.mi/mi-info-os.exp
> +++ b/gdb/testsuite/gdb.mi/mi-info-os.exp
> @@ -33,6 +33,26 @@ if [mi_gdb_start] {
>      continue
>  }
>  
> +standard_testfile basics.c
> +
> +if [build_executable "Failed to build $testfile" $testfile $srcfile \
> +	debug] {
> +    return -1;
> +}
> +if {[mi_gdb_load $binfile] < 0} {
> +    return -1
> +}
> +# When testing a cross configuration, we need to be sure to first
> +# connect to the target.  If we didn't do that, GDB would try running
> +# the command against the default run target.  The usual way to do
> +# that and covera all target is to run to main, with mi_run_to_main.
> +# However, with native configurations, -info-os should work before
> +# running any program, so we want to avoid "run".  Using
> +# mi_gdb_target_load directly instead achieves this.
> +if {[mi_gdb_target_load] < 0} {
> +    return -1
> +}
> +
>  # Try the argument-less form that lists all the types in a table.
>  
>  mi_gdb_test "-info-os" ".*\\^done,OSDataTable=.*" "-info-os"
> 


  reply	other threads:[~2014-01-09 20:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01  1:17 Maciej W. Rozycki
2013-11-20 19:04 ` [PING][PATCH] " Maciej W. Rozycki
2013-11-20 20:01 ` [PATCH] " Pedro Alves
2013-11-20 21:21   ` Maciej W. Rozycki
2013-11-21 11:47     ` Pedro Alves
2014-01-09 20:53       ` Pedro Alves [this message]
2014-01-09 23:05         ` Maciej W. Rozycki
2014-01-10 11:02           ` Pedro Alves

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=52CF08E6.5060202@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@codesourcery.com \
    --cc=stan@codesourcery.com \
    /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