public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Yao Qi <qiyaoltc@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code
Date: Fri, 08 May 2015 05:09:00 -0000	[thread overview]
Message-ID: <874mnn1wvn.fsf@redhat.com> (raw)
In-Reply-To: <554A3D61.8090302@redhat.com> (Pedro Alves's message of "Wed, 06	May 2015 17:12:17 +0100")

On Wednesday, May 06 2015, Pedro Alves wrote:

>> 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...

FWIW, I managed to solve the problem by hacking
/usr/share/dejagnu/rsh.exp:rsh_exec and doing:

  set ret [local_exec "$RSH $rsh_useropts $hostname \"sh -c '$program $pargs \\; echo XYZ\\\${?}ZYX'\"" $inp $outp $timeout]

Then I found this message by Pedro.

But only doing this is not enough: because of the quote-hell, the
coredump-filter.exp needs to be adjusted to:

  remote_exec target "echo $filter_flag > /proc/$ipid/coredump_filter"

I.e., remove the "sh -c" and the extra quotes.  After that, everything
passes.

Since the full solution involves hacking dejagnu, then I agree that a
most desirable solution is to hack the C source file as Yao did.

Thanks,

-- 
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF  31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/

      parent reply	other threads:[~2015-05-08  5:09 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
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 [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=874mnn1wvn.fsf@redhat.com \
    --to=sergiodj@redhat.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).