Re: [PATCH 04/12] Delete reinsert breakpoints from forked child

Yao Qi
2016-06-13T16:53:44Z

Pedro Alves <palves@redhat.com> writes:

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

I thought 20 is big enough to include the previous instruction in.
The max instruction length of x86 is 16. If we disassemble in the
middle of an instruction, and garbage is printed, it is a bug, and we
should fix in disassembler.

I can't find another way to show the previous instruction.

>> + -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)".
>

I'll fix it.

>> + 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?
>

I'll fix it.

>> + # 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
>

What is difference between the second one and third one? I think
they've already covered by gdb.base/step-over-syscall.exp.

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

--
Yao (齐尧)