Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <dan@codesourcery.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch-testcase] Re: RFC: Verify AT_ENTRY before using it
Date: Mon, 08 Mar 2010 22:13:00 -0000	[thread overview]
Message-ID: <20100308221349.GD2629@caradoc.them.org> (raw)
In-Reply-To: <20100301212216.GA30906@host0.dyn.jankratochvil.net>

On Mon, Mar 01, 2010 at 10:22:16PM +0100, Jan Kratochvil wrote:
> +  if (info_verbose)
> +    {
> +      /* It can be printed repeatedly as there is no easy way to check
> +	 the executable symbols/file has been already relocated to
> +	 displacement.  */
> +
> +      warning (_("Using PIE (Position Independent Executable) "
> +		 "displacement %s for \"%s\""),
> +	       paddress (target_gdbarch, displacement),
> +	       bfd_get_filename (exec_bfd));
> +    }
> +
>    return displacement;
>  }

This isn't a warning; just use printf_unfiltered.

> +	    -re "Using PIE \\(Position Independent Executable\\) displacement 0x0 " {
> +		# Missing "$gdb_prompt $" is intentional.
> +		if {$displacement == "ZERO"} {
> +		    pass $test_displacement
> +		    # Permit multiple such messages.
> +		    set displacement "FOUND-$displacement"
> +		} elseif {$displacement != "FOUND-ZERO"} {
> +		    fail $test_displacement
> +		}
> +		exp_continue
> +	    }
> +	    -re "Using PIE \\(Position Independent Executable\\) displacement" {
> +		# Missing "$gdb_prompt $" is intentional.
> +		if {$displacement == "NONZERO"} {
> +		    pass $test_displacement
> +		    # Permit multiple such messages.
> +		    set displacement "FOUND-$displacement"
> +		} elseif {$displacement != "FOUND-NONZERO"} {
> +		    fail $test_displacement
> +		}
> +		exp_continue
> +	    }

This isn't a safe way to use expect, unfortunately.  If you have two
patterns, and the second one matches a subset of the first, either
might match; it depends where the OS and C library break up GDB's call
to 'write'.  You have two choices: combine the patterns, and check the
displacement inside, or make the second pattern not match the first.
For instance, " 0x[0-9a-f]*[1-9a-f]*[0-9a-f]* " won't match 0x0.

Otherwise OK.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2010-03-08 22:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-24 22:49 Daniel Jacobowitz
2010-02-25 22:16 ` Jan Kratochvil
2010-02-26 21:12   ` Daniel Jacobowitz
2010-03-01 20:04     ` Jan Kratochvil
2010-03-01 21:22       ` [patch-testcase] " Jan Kratochvil
2010-03-08 22:13         ` Daniel Jacobowitz [this message]
2010-03-11 21:54           ` Jan Kratochvil
2010-03-11 21:57             ` Daniel Jacobowitz
2010-03-11 22:07               ` Jan Kratochvil
2010-03-08 22:06       ` Daniel Jacobowitz
2010-03-10 21:11         ` Jan Kratochvil
2010-03-10 21:55           ` Daniel Jacobowitz
2010-03-12 15:28           ` Jan Kratochvil
2010-03-12 15:39             ` Daniel Jacobowitz
2010-03-14  9:00               ` Jan Kratochvil

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=20100308221349.GD2629@caradoc.them.org \
    --to=dan@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.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