+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.
+
2015-05-08 Andreas Arnez <arnez@linux.vnet.ibm.com>
* gdb.base/watch_thread_num.exp: Skip test on targets without
gdb_breakpoint [gdb_get_line_number "break-here"]
gdb_continue_to_breakpoint "break-here" ".* break-here .*"
-proc do_save_core { filter_flag core ipid } {
- verbose -log "writing $filter_flag to /proc/$ipid/coredump_filter"
+proc do_save_core { filter_flag core } {
+ verbose -log "writing $filter_flag to /proc/<inferior pid>/coredump_filter"
- remote_exec target "sh -c \"echo $filter_flag > /proc/$ipid/coredump_filter\""
+ gdb_test "p set_coredump_filter ($filter_flag)" " = 0"
# Generate a corefile.
gdb_gcore_cmd "$core" "save corefile"
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),
# Generate corefiles for the "anon" case.
foreach item $all_anon_corefiles {
with_test_prefix "saving corefile for [lindex $item 0]" {
- do_save_core [lindex $item 1] [subst [lindex $item 2]] $infpid
+ do_save_core [lindex $item 1] [subst [lindex $item 2]]
}
}
with_test_prefix "saving corefile for non-Private-Shared-Anon-File" {
- do_save_core "0x60" $non_private_shared_anon_file_core $infpid
+ do_save_core "0x60" $non_private_shared_anon_file_core
}
clean_restart $testfile