From 7890fb45667484d99488b047551bc9dd6d1c9889 Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Thu, 9 Jul 2015 16:35:11 +0100 Subject: [PATCH] [testsuite][AArch64] Port gdb.trace This patch adds support for AArch64 to the gdb.trace testsuite. Note that it does not add support for testing fast tracepoint as it isn't supported. Therefore the test cases with inline assembly are not ported in this patch, as we do not know what the conditions for inserting a fast tracepoint on AArch64 would be. gdb/testsuite/ChangeLog: * gdb.trace/backtrace.exp: Set registers for aarch64 target. * gdb.trace/collection.exp: Likewise. * gdb.trace/mi-trace-frame-collected.exp: Likewise. * gdb.trace/mi-trace-unavailable.exp: Likewise. * gdb.trace/report.exp: Likewise. * gdb.trace/trace-break.exp: Likewise. * gdb.trace/unavailable.exp: Likewise. * gdb.trace/while-dyn.exp: Likewise. --- gdb/ChangeLog | 11 +++++++++++ gdb/testsuite/gdb.trace/backtrace.exp | 3 +++ gdb/testsuite/gdb.trace/collection.exp | 4 ++++ gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp | 2 ++ gdb/testsuite/gdb.trace/mi-trace-unavailable.exp | 2 ++ gdb/testsuite/gdb.trace/report.exp | 4 ++++ gdb/testsuite/gdb.trace/trace-break.exp | 2 ++ gdb/testsuite/gdb.trace/unavailable.exp | 4 ++++ gdb/testsuite/gdb.trace/while-dyn.exp | 2 ++ 9 files changed, 34 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b68b60d..6a5fe22 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,16 @@ 2015-07-09 Pierre Langlois + * gdb.trace/backtrace.exp: Set registers for aarch64 target. + * gdb.trace/collection.exp: Likewise. + * gdb.trace/mi-trace-frame-collected.exp: Likewise. + * gdb.trace/mi-trace-unavailable.exp: Likewise. + * gdb.trace/report.exp: Likewise. + * gdb.trace/trace-break.exp: Likewise. + * gdb.trace/unavailable.exp: Likewise. + * gdb.trace/while-dyn.exp: Likewise. + +2015-07-09 Pierre Langlois + * aarch64-tdep.c: Add ax.h and ax-gdb.h includes. (aarch64_gen_return_address): New function. (aarch64_gdbarch_init): Hook it. diff --git a/gdb/testsuite/gdb.trace/backtrace.exp b/gdb/testsuite/gdb.trace/backtrace.exp index 045778e..f69089b 100644 --- a/gdb/testsuite/gdb.trace/backtrace.exp +++ b/gdb/testsuite/gdb.trace/backtrace.exp @@ -146,6 +146,9 @@ if [is_amd64_regs_target] { } elseif [is_x86_like_target] { set fpreg "\$ebp" set spreg "\$esp" +} elseif [is_aarch64_target] { + set fpreg "\$x29" + set spreg "\$sp" } else { set fpreg "\$fp" set spreg "\$sp" diff --git a/gdb/testsuite/gdb.trace/collection.exp b/gdb/testsuite/gdb.trace/collection.exp index bd42cfa..69ad6ee 100644 --- a/gdb/testsuite/gdb.trace/collection.exp +++ b/gdb/testsuite/gdb.trace/collection.exp @@ -44,6 +44,10 @@ if [is_amd64_regs_target] { set fpreg "ebp" set spreg "esp" set pcreg "eip" +} elseif [is_aarch64_target] { + set fpreg "x29" + set spreg "sp" + set pcreg "pc" } else { set fpreg "fp" set spreg "sp" diff --git a/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp b/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp index 51ed479..a7bed0b 100644 --- a/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp +++ b/gdb/testsuite/gdb.trace/mi-trace-frame-collected.exp @@ -56,6 +56,8 @@ if [is_amd64_regs_target] { set pcreg "rip" } elseif [is_x86_like_target] { set pcreg "eip" +} elseif [is_aarch64_target] { + set pcreg "pc" } else { # Other ports that support tracepoints should set the name of pc # register here. diff --git a/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp b/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp index 6b97d9d..ea9cddd 100644 --- a/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp +++ b/gdb/testsuite/gdb.trace/mi-trace-unavailable.exp @@ -135,6 +135,8 @@ proc test_trace_unavailable { data_source } { set pcnum 16 } elseif [is_x86_like_target] { set pcnum 8 + } elseif [is_aarch64_target] { + set pcnum 32 } else { # Other ports support tracepoint should define the number # of its own pc register. diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp index 2fa676b..b3e9000 100644 --- a/gdb/testsuite/gdb.trace/report.exp +++ b/gdb/testsuite/gdb.trace/report.exp @@ -158,6 +158,10 @@ if [is_amd64_regs_target] { set fpreg "ebp" set spreg "esp" set pcreg "eip" +} elseif [is_aarch64_target] { + set fpreg "x29" + set spreg "sp" + set pcreg "pc" } else { set fpreg "fp" set spreg "sp" diff --git a/gdb/testsuite/gdb.trace/trace-break.exp b/gdb/testsuite/gdb.trace/trace-break.exp index 4283ca6..1f57601 100644 --- a/gdb/testsuite/gdb.trace/trace-break.exp +++ b/gdb/testsuite/gdb.trace/trace-break.exp @@ -49,6 +49,8 @@ if [is_amd64_regs_target] { set fpreg "ebp" set spreg "esp" set pcreg "eip" +} elseif [is_aarch64_target] { + set fpreg "x29" } # Set breakpoint and tracepoint at the same address. diff --git a/gdb/testsuite/gdb.trace/unavailable.exp b/gdb/testsuite/gdb.trace/unavailable.exp index 5be9704..910c1dd 100644 --- a/gdb/testsuite/gdb.trace/unavailable.exp +++ b/gdb/testsuite/gdb.trace/unavailable.exp @@ -34,6 +34,10 @@ if [is_amd64_regs_target] { set fpreg "ebp" set spreg "esp" set pcreg "eip" +} elseif [is_aarch64_target] { + set fpreg "x29" + set spreg "sp" + set pcreg "pc" } else { set fpreg "fp" set spreg "sp" diff --git a/gdb/testsuite/gdb.trace/while-dyn.exp b/gdb/testsuite/gdb.trace/while-dyn.exp index 198421e..fe4535e 100644 --- a/gdb/testsuite/gdb.trace/while-dyn.exp +++ b/gdb/testsuite/gdb.trace/while-dyn.exp @@ -47,6 +47,8 @@ if [is_amd64_regs_target] { set fpreg "\$rbp" } elseif [is_x86_like_target] { set fpreg "\$ebp" +} elseif [is_aarch64_target] { + set fpreg "\$x29" } else { set fpreg "\$fp" } -- 2.7.4