public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Zied Guermazi <zied.guermazi@trande.de>
To: gdb-patches@sourceware.org, markus.t.metzger@intel.com
Cc: Zied Guermazi <zied.guermazi@trande.de>
Subject: [PATCH v6 0/7] extend branch tracing to use ARM CoreSight traces
Date: Mon, 31 May 2021 23:33:00 +0200	[thread overview]
Message-ID: <20210531213307.275079-1-zied.guermazi@trande.de> (raw)

 This patch set adds support for branch tracing in GDB on arm platforms
 using coresight etm traces
 Branch tracing offers instructions and functions histories as well as
 execution record and replay (forwards and reverse debugging)
 this patch set was tested using the gdb.btrace testsuite on ARMv7 and ARMv8
 cortex A processors running linux operating system with coresight drivers.
 
 test results of gdb.btrace testsuite on ARMv8, variation unix
 # of expected passes		595
 # of unexpected failures	1
 # of unsupported tests	1

 test results of gdb.btrace testsuite on ARMv8 variation native-gdbserver
 # of expected passes		582
 # of unexpected failures	4
 # of unsupported tests	2
 
 test results of gdb.btrace testsuite  on ARMv7, variation unix
 # of expected passes		588
 # of unexpected failures	7
 # of untested testcases	1
 # of unsupported tests	1

 
 test results of gdb.btrace testsuite on ARMv7 variation native-gdbserver
 # of expected passes		583
 # of unexpected failures	4
 # of unsupported tests	2

 
 known limitations:
 for arm v7 only
- some registers needed for breakpoint address calculation in forwards
  executions may be missing.
 for arm v7 and arm v8
- sometimes trace buffers are not flushed properly or flushed in
  the buffer of a different thread. this was observed
  in test scripts only.
- sometimes, in non-stop mode, while executing "stepi n" for two threads
  in parallel, a thread is hitting breakpoints intended for stepping
  the other one.
  Gdb recognizes that it is intended for the second thread,
  but decreases the step counter. leading to a stepping less than "n"
  times.
 patches are:

Zied Guermazi (7):
  configure gdb build system for supporting btrace on arm processors
  add btrace coresight related commands
  start/stop btrace with coresight etm and parse etm buffer. nat
    independant
  start/stop btrace with coresight etm and collect etm buffer on linux
    os
  fix issue: gdb hangs in the command following a commad returning with
    TARGET_WAITKIND_NO_HISTORY
  add support for coresight btrace via remote protocol
  adapt btrace testcases for arm target

 gdb/Makefile.in                               |   5 +-
 gdb/NEWS                                      |  27 +
 gdb/aarch64-linux-nat.c                       |  68 ++
 gdb/arch/arm.h                                |  33 +
 gdb/arm-linux-nat.c                           |  68 ++
 gdb/btrace.c                                  | 986 +++++++++++++++++-
 gdb/btrace.h                                  |  16 +-
 gdb/config.in                                 |   3 +
 gdb/configure                                 | 549 ++++++++++
 gdb/configure.nat                             |   4 +-
 gdb/doc/gdb.texinfo                           | 114 +-
 gdb/features/btrace-conf.dtd                  |  10 +-
 gdb/features/btrace.dtd                       |  38 +-
 gdb/infrun.c                                  |   3 +-
 gdb/nat/linux-btrace.c                        | 395 ++++++-
 gdb/nat/linux-btrace.h                        |  19 +
 gdb/record-btrace.c                           | 174 +++-
 gdb/record.c                                  |   2 +
 gdb/remote.c                                  |  66 +-
 .../gdb.btrace/aarch64-instruction_history.S  |  31 +
 .../gdb.btrace/aarch64-record_goto.S          | 399 +++++++
 .../gdb.btrace/aarch64-tailcall-only.S        | 516 +++++++++
 gdb/testsuite/gdb.btrace/aarch64-tailcall.S   | 408 ++++++++
 .../gdb.btrace/arm-instruction_history.S      |  31 +
 gdb/testsuite/gdb.btrace/arm-record_goto.S    | 432 ++++++++
 gdb/testsuite/gdb.btrace/arm-tailcall-only.S  | 503 +++++++++
 gdb/testsuite/gdb.btrace/arm-tailcall.S       | 390 +++++++
 gdb/testsuite/gdb.btrace/buffer-size.exp      |  15 +-
 .../gdb.btrace/instruction_history.exp        | 106 +-
 gdb/testsuite/gdb.btrace/non-stop.exp         |  60 +-
 gdb/testsuite/gdb.btrace/record_goto.exp      | 253 +++--
 gdb/testsuite/gdb.btrace/stepi.exp            | 107 +-
 gdb/testsuite/gdb.btrace/tailcall-only.exp    |  20 +-
 gdb/testsuite/gdb.btrace/tailcall.exp         |  58 +-
 ...on_history.S => x86-instruction_history.S} |   0
 gdb/testsuite/lib/gdb.exp                     |   2 +-
 gdb/top.c                                     |  10 +-
 gdbserver/config.in                           |   3 +
 gdbserver/configure                           | 545 ++++++++++
 gdbserver/configure.srv                       |   4 +
 gdbserver/linux-low.cc                        | 100 +-
 gdbserver/server.cc                           |  34 +-
 gdbsupport/Makefile.in                        |   3 +
 gdbsupport/btrace-common.cc                   |  45 +
 gdbsupport/btrace-common.h                    | 128 ++-
 gdbsupport/common.m4                          |  39 +
 gdbsupport/config.in                          |   3 +
 gdbsupport/configure                          | 545 ++++++++++
 48 files changed, 7192 insertions(+), 178 deletions(-)
 create mode 100644 gdb/testsuite/gdb.btrace/aarch64-instruction_history.S
 create mode 100644 gdb/testsuite/gdb.btrace/aarch64-record_goto.S
 create mode 100644 gdb/testsuite/gdb.btrace/aarch64-tailcall-only.S
 create mode 100644 gdb/testsuite/gdb.btrace/aarch64-tailcall.S
 create mode 100644 gdb/testsuite/gdb.btrace/arm-instruction_history.S
 create mode 100644 gdb/testsuite/gdb.btrace/arm-record_goto.S
 create mode 100644 gdb/testsuite/gdb.btrace/arm-tailcall-only.S
 create mode 100644 gdb/testsuite/gdb.btrace/arm-tailcall.S
 rename gdb/testsuite/gdb.btrace/{instruction_history.S => x86-instruction_history.S} (100%)

-- 
2.25.1


             reply	other threads:[~2021-05-31 21:33 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 21:33 Zied Guermazi [this message]
2021-05-31 21:33 ` [PATCH v6 1/7] configure gdb build system for supporting btrace on arm processors Zied Guermazi
2021-06-30 12:17   ` Luis Machado
2021-05-31 21:33 ` [PATCH v6 2/7] add btrace coresight related commands Zied Guermazi
2021-06-01 12:07   ` Eli Zaretskii
2021-06-01 15:47     ` Zied Guermazi
2021-06-30 12:26   ` Luis Machado
2021-05-31 21:33 ` [PATCH v6 3/7] start/stop btrace with coresight etm and parse etm buffer. nat independant Zied Guermazi
2021-06-22 14:59   ` Metzger, Markus T
2022-04-07 16:33     ` Zied Guermazi
2022-04-13  7:00       ` Metzger, Markus T
2022-05-10 12:58         ` Zied Guermazi
2022-05-10 13:21           ` Metzger, Markus T
2021-06-30 12:54   ` Luis Machado
2021-05-31 21:33 ` [PATCH v6 4/7] start/stop btrace with coresight etm and collect etm buffer on linux os Zied Guermazi
2021-06-23  8:00   ` Metzger, Markus T
2022-05-12 22:52     ` Zied Guermazi
2022-05-13  5:31       ` Metzger, Markus T
2022-06-12 21:02         ` Zied Guermazi
2022-06-20 12:52           ` Metzger, Markus T
2022-07-18 19:06             ` Zied Guermazi
2022-07-19  5:04               ` Metzger, Markus T
2022-07-21 22:20                 ` Zied Guermazi
2022-07-25 14:33                   ` Metzger, Markus T
2021-06-30 13:24   ` Luis Machado
2021-05-31 21:33 ` [PATCH v6 5/7] fix issue: gdb hangs in the command following a commad returning with TARGET_WAITKIND_NO_HISTORY Zied Guermazi
2021-06-23  8:08   ` Metzger, Markus T
2021-05-31 21:33 ` [PATCH v6 6/7] add support for coresight btrace via remote protocol Zied Guermazi
2021-06-01 12:08   ` Eli Zaretskii
2021-06-23 10:59   ` Metzger, Markus T
2021-05-31 21:33 ` [PATCH v6 7/7] adapt btrace testcases for arm target Zied Guermazi
2021-06-22 21:28   ` Lancelot SIX
2021-06-23 14:16   ` Metzger, Markus T
2022-05-13 11:08   ` Richard Earnshaw
2022-05-17  9:44     ` Zied Guermazi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210531213307.275079-1-zied.guermazi@trande.de \
    --to=zied.guermazi@trande.de \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).