]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/testsuite/ChangeLog-2014-2021
Fix PR 18208: update /proc/pid/coredump_filter by c code
authorYao Qi <yao.qi@linaro.org>
Fri, 8 May 2015 11:37:48 +0000 (12:37 +0100)
committerYao Qi <yao.qi@linaro.org>
Fri, 8 May 2015 11:37:48 +0000 (12:37 +0100)
commit422349a385c2ccfc1e66f5c65560e5bd5fc97953
treea449d079eb313ce48c9406719f5ce6d7e6427794
parent45614f153407762d83e8ecaf271b9b6e524c62db
Fix PR 18208: update /proc/pid/coredump_filter by c code

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

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.

This patch adds a c function set_coredump_filter to update
coredump_filter, and GDB calls it.

gdb/testsuite:

2015-05-08  Yao Qi  <yao.qi@linaro.org>

PR gdb/18208
* gdb.base/coredump-filter.c (set_coredump_filter): New function.
* gdb.base/coredump-filter.exp (do_save_core): Call inferior
function set_coredump_filter, and remove remote_exec call.
Remove argument ipid.  Callers update.
(top level): Don't get inferior's PID.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/coredump-filter.c
gdb/testsuite/gdb.base/coredump-filter.exp