This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Fri, 08 May 2015 01:06:20 -0400
- Subject: Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code
- Authentication-results: sourceware.org; auth=none
- References: <1429889336-12277-1-git-send-email-qiyaoltc at gmail dot com> <554A3D61 dot 8090302 at redhat dot com>
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/