This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [rfc] Fix PR 18208: update /proc/pid/coredump_filter by c code


On 05/07/2015 07:44 AM, Luis Machado wrote:
On 05/07/2015 06:05 AM, Yao Qi wrote:
Luis Machado <lgustavo@codesourcery.com> writes:

-# 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),

This "If the target does not provide PID information" check sounds
odd now.  Do we still need it?

If we're not dealing with PID's, i don't think so.

At the very start, I removed this block, but I recall that this block is
used as a guard for usermode QEMU which doesn't provide PID
information.  With this patch applied, we'll access
/proc/self/coredump_filter, but I am afraid it doesn't work as expected
on usermode QEMU, because usermode QEMU just intercepts few /proc
accesses and pass most of them through the host linux.  Accessing
/proc/QEMU_PID/coredump_filter isn't what we want in this test, so I
think it's better to skip the test for usermode QEMU.

Of course, I don't mind removing this block.  Luis, could you try this
patch and remove this block, see whether it causes fails on usermode
QEMU?


Yeah, that sounds problematic. I'll give it a try and will let you know.

Removing that conditional block i get 14 FAIL's, so it doesn't look like this test is suited for usermode QEMU.

Besides that, without the conditional block i also see a problem with the existing testcase using coredump_var_addr as an array but declaring it as a regular variable. It causes a number of errors. Did you notice that? Maybe it is specific to a certain version of expect.

# Obtain the address of each variable that will be checked on each
# case.
set coredump_var_addr ""
foreach item $all_anon_corefiles {
    foreach name [list [lindex $item 3] [lindex $item 4]] {
        set test "print/x $name"
        gdb_test_multiple $test $test {
            -re " = \($hex\)\r\n$gdb_prompt $" {
                set coredump_var_addr($name) $expect_out(1,string)
            }
        }
    }
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]