[rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code
Sergio Durigan Junior
sergiodj@redhat.com
Fri May 8 05:09:00 GMT 2015
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/
More information about the Gdb-patches
mailing list