public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <lgustavo@codesourcery.com>
To: Pedro Alves <palves@redhat.com>, Yao Qi <qiyaoltc@gmail.com>,
	<gdb-patches@sourceware.org>
Subject: Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code
Date: Wed, 06 May 2015 16:43:00 -0000	[thread overview]
Message-ID: <554A44B9.3090503@codesourcery.com> (raw)
In-Reply-To: <554A3D61.8090302@redhat.com>

On 05/06/2015 01:12 PM, Pedro Alves wrote:
> On 04/24/2015 04:28 PM, Yao Qi wrote:
>
>> We see some fails in gdb.base/coredump-filter.exp when we do remote
>> gdbserver testing, like what I did for arm/aarch64 linux testing or
>> run it with board file remote-gdbserver-on-localhost
>>
>>   $ make check RUNTESTFLAGS='--target_board=remote-gdbserver-on-localhost coredump-filter.exp'
>>
>> we find that this line in the test doesn't work as expected,
>>
>>   remote_exec target "sh -c \"echo $filter_flag > /proc/$ipid/coredump_filter\""
>>
>> although such pattern has been used in gdb testsuite somewhere else,
>> but the special thing here is that we redirect the output to
>> /proc/$ipid/coredump_filter on the remote target.  DejaGNU will
>> redirect the output from the remote target to local, and looks tcl
>> gets confused by these two redirection.
>
> Not sure what exactly gets confused either.
>
>>
>> After trying pass different parameters to remote_exec and hacking
>> remote_exec/rsh_exec/local_exec, I got no success, I decide
>> to give up, and try to update /proc/$ipid/coredump_filter by the c
>> code directly.
>
> Probably the right fix would be for dejagnu to put ''s around
> the whole sh -c command in rsh_exec:
>
>      set ret [local_exec "$RSH $rsh_useropts $hostname sh -c '$program $pargs \\; echo XYZ\\\${?}ZYX'" $inp $outp $timeout]
>
> dunno if that would work with real rsh.  Alternatively, teach
> dejagnu about a real ssh mode...
>
>>
>> This patch adds a c function set_coredump_filter to update
>> coredump_filter, and GDB calls it.
>>
>
> This is fine with me.
>
>> Now this test passes on boardfile unix, native-gdbserver and
>> remote-gdbserver-on-localhost.  It also passes my board files for arm
>> and aarch64 testing.
>
>
>>       # Generate a corefile.
>>       gdb_gcore_cmd "$core" "save corefile"
>> @@ -146,11 +146,8 @@ if { !$core_supported } {
>>       return -1
>>   }
>>
>> -# Get the inferior's PID.
>> -set infpid ""
>>   gdb_test_multiple "info inferiors" "getting inferior pid" {
>> -    -re "process \($decimal\).*\r\n$gdb_prompt $" {
>> -	set infpid $expect_out(1,string)
>> +    -re "process $decimal.*\r\n$gdb_prompt $" {
>>       }
>>       -re "Remote target.*$gdb_prompt $" {
>>   	# If the target does not provide PID information (like usermode QEMU),
>
> This "If the target does not provide PID information" check sounds
> odd now.  Do we still need it?

If we're not dealing with PID's, i don't think so.

  reply	other threads:[~2015-05-06 16:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24 15:29 Yao Qi
2015-05-06 16:12 ` Pedro Alves
2015-05-06 16:43   ` Luis Machado [this message]
2015-05-07  9:05     ` Yao Qi
2015-05-07 10:45       ` Luis Machado
2015-05-07 14:01         ` Luis Machado
2015-05-07 17:05           ` [PATCH] Fix coredump-filter.exp by correctly unsetting array (was: Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code) Sergio Durigan Junior
2015-05-08 11:57             ` [PATCH] Fix coredump-filter.exp by correctly unsetting array Yao Qi
2015-05-08 17:23               ` Sergio Durigan Junior
2015-05-08 11:41           ` [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code Yao Qi
2015-05-08 14:40           ` Pedro Alves
2015-05-08 14:47             ` Luis Machado
2015-05-08  5:09   ` Sergio Durigan Junior

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=554A44B9.3090503@codesourcery.com \
    --to=lgustavo@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --cc=qiyaoltc@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).