public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: gdb-patches@sourceware.org
Subject: [PATCH V5 0/3] eBPF support
Date: Mon, 13 Jul 2020 14:24:55 +0200	[thread overview]
Message-ID: <20200713122458.21339-1-jose.marchesi@oracle.com> (raw)

[Changes from V4:
- Rebased to today's master.
- Remove bpf-tdep.h.
- Clarify in bpf_frame_this_id why this_id is not set.
- Make the GDB patch independent from the sim patch.
- Indentation/style fixes.
- Copyright year fixed in sim/bpf/Makefile.in
- CGEN_MAIN -> CGEN_MAINT typo fixed in sim/bpf/Makefile.in
- Removed XXX comments from sim/bpf/Makefile.in
- Removed spurious comment from sim/bpf/sim-if.c]

Hi good peoples!

This patch series adds support for the eBPF virtual architecture to
GDB [1].

The first patch contains the basic bits to GDB in order to support the
bpf-unknown-none target.  Breakpointing and instruction
single-stepping works, but the debugging support in eBPF is still very
minimal.  This is mainly due to the many limitations imposed by the
architecture (disjoint stack, maximum stack size, etc).  We are
working to overcome these limitations, by introducing a variant called
xbpf, already supported in GCC with the -mxbpf option, whose purpose
is to ease debugging and to be used in other contexts different than
the Linux kernel, less restrictive.

The second patch adds a basic CGEN-based instruction simulator for
eBPF.  It can run many eBPF programs and works well with GDB.  A
testsuite covering the supported instructions is also included.  We
will be expanding it in order to emulate the several kernel contexts
in which eBPF programs can run, so eBPF developers can use GDB to
debug their programs without having to load them in a running kernel.
Currently the only kernel helper implemented in the simulator is
printk, which is used by the tests.

We of course commit to maintain and evolve this stuff :)

[1] Support for eBPF has been already added to both binutils and GCC.

Jose E. Marchesi (3):
  gdb: support for eBPF
  sim: eBPF simulator
  sim: generated files for the eBPF simulator

 gdb/ChangeLog                       |    12 +
 gdb/Makefile.in                     |     2 +
 gdb/bpf-tdep.c                      |   373 +
 gdb/configure.tgt                   |     6 +
 gdb/doc/ChangeLog                   |     6 +
 gdb/doc/gdb.texinfo                 |    21 +
 sim/ChangeLog                       |    42 +
 sim/MAINTAINERS                     |     1 +
 sim/bpf/Makefile.in                 |   203 +
 sim/bpf/aclocal.m4                  |   119 +
 sim/bpf/arch.c                      |    35 +
 sim/bpf/arch.h                      |    50 +
 sim/bpf/bpf-helpers.c               |   175 +
 sim/bpf/bpf-helpers.def             |   194 +
 sim/bpf/bpf-helpers.h               |    31 +
 sim/bpf/bpf-sim.h                   |    31 +
 sim/bpf/bpf.c                       |   327 +
 sim/bpf/config.in                   |   248 +
 sim/bpf/configure                   | 15942 ++++++++++++++++++++++++++
 sim/bpf/configure.ac                |    13 +
 sim/bpf/cpu.c                       |    69 +
 sim/bpf/cpu.h                       |    81 +
 sim/bpf/cpuall.h                    |    65 +
 sim/bpf/decode-be.c                 |  1129 ++
 sim/bpf/decode-be.h                 |    94 +
 sim/bpf/decode-le.c                 |  1129 ++
 sim/bpf/decode-le.h                 |    94 +
 sim/bpf/decode.h                    |    37 +
 sim/bpf/defs-be.h                   |   383 +
 sim/bpf/defs-le.h                   |   383 +
 sim/bpf/eng.h                       |    24 +
 sim/bpf/mloop.in                    |   165 +
 sim/bpf/sem-be.c                    |  3207 ++++++
 sim/bpf/sem-le.c                    |  3207 ++++++
 sim/bpf/sim-if.c                    |   214 +
 sim/bpf/sim-main.h                  |    51 +
 sim/bpf/traps.c                     |    33 +
 sim/configure                       |     8 +
 sim/configure.tgt                   |     3 +
 sim/testsuite/ChangeLog             |    17 +
 sim/testsuite/configure             |     9 +-
 sim/testsuite/sim/bpf/allinsn.exp   |    26 +
 sim/testsuite/sim/bpf/alu.s         |   109 +
 sim/testsuite/sim/bpf/alu32.s       |    99 +
 sim/testsuite/sim/bpf/endbe.s       |    46 +
 sim/testsuite/sim/bpf/endle.s       |    43 +
 sim/testsuite/sim/bpf/jmp.s         |   120 +
 sim/testsuite/sim/bpf/jmp32.s       |   120 +
 sim/testsuite/sim/bpf/ldabs.s       |    87 +
 sim/testsuite/sim/bpf/mem.s         |    56 +
 sim/testsuite/sim/bpf/mov.s         |    54 +
 sim/testsuite/sim/bpf/testutils.inc |    38 +
 sim/testsuite/sim/bpf/xadd.s        |    44 +
 53 files changed, 29072 insertions(+), 3 deletions(-)
 create mode 100644 gdb/bpf-tdep.c
 create mode 100644 sim/bpf/Makefile.in
 create mode 100644 sim/bpf/aclocal.m4
 create mode 100644 sim/bpf/arch.c
 create mode 100644 sim/bpf/arch.h
 create mode 100644 sim/bpf/bpf-helpers.c
 create mode 100644 sim/bpf/bpf-helpers.def
 create mode 100644 sim/bpf/bpf-helpers.h
 create mode 100644 sim/bpf/bpf-sim.h
 create mode 100644 sim/bpf/bpf.c
 create mode 100644 sim/bpf/config.in
 create mode 100755 sim/bpf/configure
 create mode 100644 sim/bpf/configure.ac
 create mode 100644 sim/bpf/cpu.c
 create mode 100644 sim/bpf/cpu.h
 create mode 100644 sim/bpf/cpuall.h
 create mode 100644 sim/bpf/decode-be.c
 create mode 100644 sim/bpf/decode-be.h
 create mode 100644 sim/bpf/decode-le.c
 create mode 100644 sim/bpf/decode-le.h
 create mode 100644 sim/bpf/decode.h
 create mode 100644 sim/bpf/defs-be.h
 create mode 100644 sim/bpf/defs-le.h
 create mode 100644 sim/bpf/eng.h
 create mode 100644 sim/bpf/mloop.in
 create mode 100644 sim/bpf/sem-be.c
 create mode 100644 sim/bpf/sem-le.c
 create mode 100644 sim/bpf/sim-if.c
 create mode 100644 sim/bpf/sim-main.h
 create mode 100644 sim/bpf/traps.c
 create mode 100644 sim/testsuite/sim/bpf/allinsn.exp
 create mode 100644 sim/testsuite/sim/bpf/alu.s
 create mode 100644 sim/testsuite/sim/bpf/alu32.s
 create mode 100644 sim/testsuite/sim/bpf/endbe.s
 create mode 100644 sim/testsuite/sim/bpf/endle.s
 create mode 100644 sim/testsuite/sim/bpf/jmp.s
 create mode 100644 sim/testsuite/sim/bpf/jmp32.s
 create mode 100644 sim/testsuite/sim/bpf/ldabs.s
 create mode 100644 sim/testsuite/sim/bpf/mem.s
 create mode 100644 sim/testsuite/sim/bpf/mov.s
 create mode 100644 sim/testsuite/sim/bpf/testutils.inc
 create mode 100644 sim/testsuite/sim/bpf/xadd.s

-- 
2.25.0.2.g232378479e


             reply	other threads:[~2020-07-13 12:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13 12:24 Jose E. Marchesi [this message]
2020-07-13 12:24 ` [PATCH V5 1/3] gdb: support for eBPF Jose E. Marchesi
2020-07-13 13:04   ` Eli Zaretskii
2020-07-13 13:30     ` Jose E. Marchesi
2020-08-01 23:25   ` Simon Marchi
2020-08-01 23:32     ` Simon Marchi
2020-07-13 12:24 ` [PATCH V5 2/3] sim: eBPF simulator Jose E. Marchesi
2020-07-13 12:24 ` [PATCH V5 3/3] sim: generated files for the " Jose E. Marchesi
2020-07-20 19:17 ` [PATCH V5 0/3] eBPF support Jose E. Marchesi
2020-08-01 23:16 ` Simon Marchi

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=20200713122458.21339-1-jose.marchesi@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=gdb-patches@sourceware.org \
    /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).