Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Aleksandar Ristovski <ARistovski@qnx.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 8/8] Tests for validate symbol file using build-id.
Date: Thu, 18 Apr 2013 10:15:00 -0000	[thread overview]
Message-ID: <20130417203321.GD2090@host2.jankratochvil.net> (raw)
In-Reply-To: <1366127096-5744-9-git-send-email-ARistovski@qnx.com>

On Tue, 16 Apr 2013 17:44:56 +0200, Aleksandar Ristovski wrote:
[...]
> +proc solib_matching_test { solibfile symsloaded msg } {
> +  global gdb_prompt
> +  global testfile
> +  global executable
> +  global srcdir
> +  global subdir
> +  global binlibfiledirrun
> +  global binlibfiledirgdb
> +  global srcfile
> +
> +  clean_restart ${binlibfiledirrun}/${executable}
> +
> +  gdb_test_no_output "set solib-search-path \"${binlibfiledirgdb}\"" ""
> +  if { [gdb_test "cd ${binlibfiledirgdb}" "" ""] != 0 } {
> +    untested "cd ${binlibfiledirgdb}"
> +    return -1
> +  }
> +
> +  # Do not auto load shared libraries, the test needs to have control
> +  # over when the relevant output gets printed.
> +  gdb_test_no_output "set auto-solib-add off" ""
> +
> +  if ![runto "${srcfile}:[gdb_get_line_number "set breakpoint 1 here"]"] {
> +    return -1
> +  }
> +
> +  gdb_test "sharedlibrary" "" ""
> +
> +  set nocrlf "\[^\r\n\]*"
> +  set expected_header "From${nocrlf}To${nocrlf}Syms${nocrlf}Read${nocrlf}Shared${nocrlf}"
> +  set expected_line "${symsloaded}${nocrlf}${solibfile}"
> +
> +  gdb_test "info sharedlibrary ${solibfile}" \
> +    "${expected_header}\r\n.*${expected_line}.*" \
> +    "${msg} - Symbols for ${solibfile} loaded: expected '${symsloaded}'"
> +
> +  return 0
> +}
> +
> +# Copy binary to working dir so it pulls in the library from that dir
> +# (by the virtue of $ORIGIN).
> +file copy -force "${binlibfiledirgdb}/${executable}" \
> +		 "${binlibfiledirrun}/${executable}"
> +
> +# Test unstripped, .dynamic matching
> +if { [solib_matching_test "${binlibfilebase}" "No" \
> +      "test unstripped, .dynamic matching"] != 0 } {
> +  untested "test unstripped, .dynamic matching"

I do not understand this message.  "untested" means some tests were skipped.
But here no tests are skipped.

And the callee in one case already prints "untested" itself
(cd ${binlibfiledirgdb}) and in other case it just prints FAIL without any
"untested" output (runto).  In the first case there will be two "untested"
messages.

When you are so corrected with "untested" messages make sure it is printed
even in the failed "runto" case and also that "untested" is printed only once.



> +}
> + 
> +# Keep original so for debugging purposes
> +file copy -force "${binlibfilegdb}" "${binlibfilegdb}-orig"
> +set objcopy_program [transform objcopy]
> +set result [catch "exec $objcopy_program --only-keep-debug ${binlibfilegdb}"]
> +if {$result != 0} {
> +  untested "test --only-keep-debug (objcopy)"

"untested" is inappropriate here because no tests are skipped.  Either put
also "return -1" here or remove the "untested" message.

Maybe you meant "xfail" here, that something failed in the supporting system
environment.


> +}
> +
> +# Test --only-keep-debug, .dynamic matching so
> +if { [solib_matching_test "${binlibfilebase}" "No" \
> +      "test --only-keep-debug"] != 0 } {
> +  untested "test --only-keep-debug"

Likewise probably "xfail".


> +}
> +
> +# Keep previous so for debugging puroses 
> +file copy -force "${binlibfilegdb}" "${binlibfilegdb}-orig1"
> +
> +# Copy loaded so over the one gdb will find 
> +file copy -force "${binlibfilerun}" "${binlibfilegdb}"
> +
> +# Now test it does not mis-invalidate matching libraries
> +if { [solib_matching_test "${binlibfilebase}" "Yes" \
> +      "test matching libraries"] } {
> +  untested "test matching libraries"

Likewise duplicate "untested" message.


> +}
> -- 
> 1.7.10.4


Thanks,
Jan


  reply	other threads:[~2013-04-17 20:34 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 16:15 [PATCH 0/8] v2 - validate binary before use Aleksandar Ristovski
2013-04-09 15:53 ` [PATCH 1/8] Move utility functions to common/ Aleksandar Ristovski
2013-04-09 16:01 ` [PATCH 2/8] Merge multiple hex conversions Aleksandar Ristovski
2013-04-09 16:03 ` [PATCH 3/8] Create empty common/linux-maps.[ch] and common/common-target.[ch] Aleksandar Ristovski
2013-04-15 13:34   ` Jan Kratochvil
2013-04-09 16:39 ` [PATCH 4/8] Prepare linux_find_memory_regions_full & co. for move Aleksandar Ristovski
2013-04-15 13:36   ` Jan Kratochvil
2013-04-16 17:19     ` Aleksandar Ristovski
2013-04-09 16:48 ` [PATCH 5/8] Move linux_find_memory_regions_full & co Aleksandar Ristovski
2013-04-15 13:52   ` Jan Kratochvil
2013-04-16 15:46     ` Aleksandar Ristovski
2013-04-09 16:55 ` [PATCH 6/8] gdbserver build-id attribute generator Aleksandar Ristovski
2013-04-09 18:52   ` Eli Zaretskii
2013-04-15 14:23   ` Jan Kratochvil
2013-04-16 16:40     ` Aleksandar Ristovski
2013-04-18 10:08       ` Jan Kratochvil
2013-04-09 17:37 ` [PATCH 8/8] Tests for validate symbol file using build-id Aleksandar Ristovski
2013-04-15 15:12   ` Jan Kratochvil
2013-04-16 17:25     ` Aleksandar Ristovski
2013-04-18  5:37       ` Jan Kratochvil
2013-04-09 17:50 ` [PATCH 7/8] Validate " Aleksandar Ristovski
2013-04-10 22:35   ` Aleksandar Ristovski
2013-04-10 19:58     ` Aleksandar Ristovski
2013-04-11  1:26     ` Jan Kratochvil
2013-04-11  2:43       ` Aleksandar Ristovski
2013-04-15 14:58   ` Jan Kratochvil
2013-04-16 19:14     ` Aleksandar Ristovski
2013-04-18 10:23       ` Jan Kratochvil
2013-04-09 17:53 ` [PATCH 0/8] v2 - validate binary before use Jan Kratochvil
2013-04-09 18:09   ` Aleksandar Ristovski
2013-04-16 18:03 ` Aleksandar Ristovski
2013-04-16 18:30   ` [PATCH 7/8] Validate symbol file using build-id Aleksandar Ristovski
2013-04-16 18:30   ` [PATCH 2/8] Merge multiple hex conversions Aleksandar Ristovski
2013-04-16 18:31   ` [PATCH 5/8] Move linux_find_memory_regions_full & co Aleksandar Ristovski
2013-04-16 18:31   ` [PATCH 8/8] Tests for validate symbol file using build-id Aleksandar Ristovski
2013-04-18 10:15     ` Jan Kratochvil [this message]
2013-04-16 18:31   ` [PATCH 6/8] gdbserver build-id attribute generator Aleksandar Ristovski
2013-04-18  7:40     ` Jan Kratochvil
2013-04-16 18:31   ` [PATCH 1/8] Move utility functions to common/ Aleksandar Ristovski
2013-04-16 18:31   ` [PATCH 4/8] Prepare linux_find_memory_regions_full & co. for move Aleksandar Ristovski
2013-04-18  8:58     ` Jan Kratochvil
2013-04-16 20:24   ` [PATCH 3/8] Create empty common/linux-maps.[ch] and common/common-target.[ch] Aleksandar Ristovski

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=20130417203321.GD2090@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=ARistovski@qnx.com \
    --cc=gdb-patches@sourceware.org \
    /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