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: [PATCH 04/12] Delete reinsert breakpoints from forked child


The gdbserver hunk looks fine to me.  Comments on the test below.

On 06/02/2016 10:30 AM, Yao Qi wrote:

> +    set syscall_insn_addr ""
> +    set test "get syscall_insn_addr"
> +    gdb_test_multiple "disassemble \$pc - 20,+30" $test {

Hmm, "\$pc - 20" doesn't look right for e.g., x86 with variable
length instructions.  I think that can well start disassembling
in the middle of an instruction, and produce garbage.

> +	-re " ($hex)\[^\r\n\]+\r\n=> .*$gdb_prompt $" {
> +	    set syscall_insn_addr $expect_out(1,string)
> +	    pass $test
> +	}
> +    }
> +
> +    if { $syscall_insn_addr == "" } {
> +	fail $test
> +	return
> +    }
> +
> +    delete_breakpoints
> +
> +    gdb_test "break marker"
> +
> +    gdb_test "continue" "Continuing\\..*Breakpoint $decimal, .*" \
> +	"continue to marker (1)"

No " ($foo)".

> +    set test "set breakpoint condition-evaluation target"
> +    gdb_test_multiple $test $test {
> +	-re "warning: Target does not support breakpoint condition evaluation.\r\nUsing host evaluation mode instead.\r\n$gdb_prompt $" {
> +	    # Target doesn't support breakpoint condition
> +	    # evaluation on its side.
> +	}
> +	-re "^$test\r\n$gdb_prompt $" {
> +	}
> +    }

No pass call?

> +    # Create a breakpoint which evaluates false.
> +    gdb_test "break \*$syscall_insn_addr if main == 0" \
> +	"Breakpoint \[0-9\]* at .*"

This ends up with "$syscall_insn_addr" in the test message.


I'm thinking that it might be good for these tests to also have
a displaced-stepping on/off test axis.  Or better still:

 out-of-line-step-over-bp / in-line-step-over-bp / plain-single-step

with the single-step variant doing a single-step over the
syscall instruction, with no breakpoint at PC at all.

Thanks,
Pedro Alves


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