public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tiezhu Yang <yangtiezhu@loongson.cn>, gdb-patches@sourceware.org
Subject: Re: [PATCH v5 0/4] gdb: add gdb_attach to fix failed testcases
Date: Tue, 22 Mar 2022 11:24:07 +0000	[thread overview]
Message-ID: <41315662-0b71-2c78-c5c9-56209196ca73@palves.net> (raw)
In-Reply-To: <1647931285-6283-1-git-send-email-yangtiezhu@loongson.cn>

On 2022-03-22 06:41, Tiezhu Yang wrote:
> Please review this v5 patchset, thank you.

Looks fine to me.

BTW, I tried setting ptrace_scope=1 and then running gdb.base/attach.exp, as probably the main attach testcase, and it
unsurprisingly FAILs:

 $ echo 1 | sudo tee /proc/sys/kernel/yama/ptrace_scope
 $ make check TESTS="gdb.base/attach.exp"
 ...
 Running /home/pedro/gdb/build/gdb/testsuite/../../../src/gdb/testsuite/gdb.base/attach.exp ...
 FAIL: gdb.base/attach.exp: do_attach_tests: attach1, after setting file
 FAIL: gdb.base/attach.exp: do_attach_tests: attach1 detach (the program is no longer running)
 FAIL: gdb.base/attach.exp: do_attach_tests: attach2, with no file
 FAIL: gdb.base/attach.exp: do_attach_tests: after attach2, set should_exit
 FAIL: gdb.base/attach.exp: do_attach_tests: continue to breakpoint: postloop (the program is no longer running)
 FAIL: gdb.base/attach.exp: do_attach_tests: continue until exit at after attach2, exit (the program is no longer running)
 FAIL: gdb.base/attach.exp: do_attach_tests: attach when process' a.out not in cwd
 ...


The curious thing is that the first FAIL is already a gdb_test_multiple:

    set test "attach1, after setting file"
    gdb_test_multiple "attach $testpid" "$test" {
	-re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $" {
	    pass "$test"
	}
	-re "Attaching to program.*`?$escapedbinfile\.exe'?, process $testpid.*\[Switching to thread $testpid\..*\].*$gdb_prompt $" {
	    # Response expected on Cygwin
	    pass "$test"
	}
    }

So I really think we will want to do the idea at 
<https://sourceware.org/pipermail/gdb-patches/2022-March/186795.html>.  But it can be
done after your patches are in.  I'm fine with you merging what you have as is.

      parent reply	other threads:[~2022-03-22 11:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22  6:41 Tiezhu Yang
2022-03-22  6:41 ` [PATCH v5 1/4] gdb: testsuite: remove attach test from can_spawn_for_attach Tiezhu Yang
2022-03-22  6:41 ` [PATCH v5 2/4] gdb: testsuite: add new gdb_attach to check "attach" command Tiezhu Yang
2022-03-22  6:41 ` [PATCH v5 3/4] gdb: testsuite: use gdb_attach to fix attach-pie-noexec.exp Tiezhu Yang
2022-03-22  6:41 ` [PATCH v5 4/4] gdb: testsuite: use gdb_attach to fix jit-elf.exp Tiezhu Yang
2022-03-22 11:24 ` Pedro Alves [this message]

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=41315662-0b71-2c78-c5c9-56209196ca73@palves.net \
    --to=pedro@palves.net \
    --cc=gdb-patches@sourceware.org \
    --cc=yangtiezhu@loongson.cn \
    /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).