public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Pedro Alves <pedro@palves.net>
Cc: gdb-patches@sourceware.org, Tom de Vries <tdevries@suse.de>
Subject: Re: [PATCH v5] [gdb/testsuite] New test: gdb.base/check-errno.exp
Date: Sat, 11 May 2024 14:57:41 -0700	[thread overview]
Message-ID: <20240511145741.70de922a@f40-zbm-amd> (raw)
In-Reply-To: <79ade103-ccb5-4d91-8cc1-231aeffa904a@palves.net>

Hi Pedro,

Thanks for your review!

On Fri, 10 May 2024 14:08:24 +0100
Pedro Alves <pedro@palves.net> wrote:

> Actually, you can also use -wrap to simplify further:
> 
>     gdb_test_multiple "ptype errno" "" {
> 	-re -wrap "type = int" {
> 	    pass $gdb_test_name
> 	}

I've made all of your suggested fixes, except for the one above.

While I can use -wrap for the above RE, if I also use it for the next
RE, I see failures when using check-read1 when testing on a machine
without glibc debuginfo.  For the moment, I've decided against using
-wrap, but if I get time, I'll revisit it and try to understand why
it's failing.

This isn't working for me:

    gdb_test_multiple "ptype errno" "check errno type availability" {
	-re -wrap "type = int" {
	    pass $gdb_test_name
	}
	-re -wrap "type = .*no debug info" {
	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	}
	-re -wrap ".*Cannot find thread-local variables on this target" {
	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	    set do_xfail_cast 1
	}
	-re -wrap ".*Cannot find thread-local storage" {
	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	    set do_xfail_cast 1
	}
	-re -wrap ".*has unknown return type; cast the call to its declared return type" {

	    # On systems which glibc as the C library, using -g3,
	    # which causes macro information to be included in the
	    # debuginfo, errno might be defined as follows:
	    #
	    #   #define errno (*__errno_location ())
	    #
	    # So, when we do "ptype errno", due to macro expansion,
	    # this ends up being "ptype (*__errno_location ())".  So
	    # the call to __errno_location (or something similar on
	    # other OSes) is the call mentioned in the error message.

	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	    set do_xfail_cast 1
	}
    }

But this is:

    gdb_test_multiple "ptype errno" "check errno type availability" {
	-re "type = int\r\n$::gdb_prompt $" {
	    pass $gdb_test_name
	}
	-re "type = .*no debug info.*$::gdb_prompt $" {
	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	}
	-re ".*Cannot find thread-local variables on this target.*$::gdb_prompt $" {
	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	    set do_xfail_cast 1
	}
	-re ".*Cannot find thread-local storage.*$::gdb_prompt $" {
	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	    set do_xfail_cast 1
	}
	-re ".*has unknown return type; cast the call to its declared return type.*$::gdb_prompt $" {

	    # On systems which glibc as the C library, using -g3,
	    # which causes macro information to be included in the
	    # debuginfo, errno might be defined as follows:
	    #
	    #   #define errno (*__errno_location ())
	    #
	    # So, when we do "ptype errno", due to macro expansion,
	    # this ends up being "ptype (*__errno_location ())".  So
	    # the call to __errno_location (or something similar on
	    # other OSes) is the call mentioned in the error message.

	    pass $gdb_test_name
	    set do_xfail 1
	    set do_xfail_core_test 1
	    set do_xfail_cast 1
	}
    }

Kevin


  reply	other threads:[~2024-05-11 21:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 21:10 Kevin Buettner
2024-05-10  8:40 ` Tom de Vries
2024-05-11 19:30   ` Kevin Buettner
2024-05-10 13:08 ` Pedro Alves
2024-05-11 21:57   ` Kevin Buettner [this message]
2024-05-13 14:34     ` Pedro Alves
2024-05-10 13:12 ` 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=20240511145741.70de922a@f40-zbm-amd \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).