Re: [PATCH] gdb.trace: Move more target dependencies to trace-support.exp

Pedro Alves
2016-02-25T13:45:43Z

On 02/19/2016 12:23 PM, Marcin KoÅ›cielnicki wrote:

> For some strange reason, the call_insn setting code already knew about
> arm, powerpc, s390, and mips - I went ahead and added the remaining
> information about those. I'm not particularly sure if I got mips right,
> but that won't matter anyway until someone actually writes tracepoint
> support for that.

The gdb.trace/entry-values.exp testcase runs some tests before restarting gdb
for a trace session. That first part of the testcase runs on all targets.

I'm not sure I really like this moving of test-specific variables that aren't
shared by more tests, to the shared trace support file. Several of these are
only used after gdb_target_supports_trace checks. So we could also say that
the problem is that the tests are skipped. E.g., in ftrace.exp:

# This expression is used for testing emit_reg.
if [is_amd64_regs_target] {
set arg0exp "\$rdi"
} elseif [is_x86_like_target] {
set arg0exp "*(int *) (\$ebp + 8)"
} elseif { [istarget "aarch64*-*-*"] } {
set arg0exp "\$x0"
} else {
set arg0exp ""
}

if { "$arg0exp" != "" } {
test_ftrace_condition "($arg0exp > 500)" "globvar" { 6 7 8 9 10 }
}

If we removed the else branch or set arg0exp to "port me", someone porting
fast tracepoints to a new architecture would notice it, instead of silently
getting the test skipped.

Thanks,
Pedro Alves