Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: "Daniel Xu" <dxu@dxuuu.xyz>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH V3 0/3] eBPF support
Date: Sun, 05 Jul 2020 02:27:05 +0200	[thread overview]
Message-ID: <87y2nyq012.fsf@oracle.com> (raw)
In-Reply-To: <C3XA0MPCA29A.XSNUKT5CXBYN@maharaja> (Daniel Xu's message of "Fri, 03 Jul 2020 13:37:40 -0700")


Hi Daniel.

    On Fri Jul 3, 2020 at 5:46 AM PDT, Jose E. Marchesi via Gdb-patches wrote:
    > [Changes from V2:
    > - Urgh, V2 contained a patch still too big for mailman. In this
    > version I am splitting the simulator part in two commits. Thunks
    > for fully generated configure files are still removed.]
    >
    > 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.
    
    This is quite exciting for bpf developers.

There is still a lot of work to do, but I am positive that eventually we
will achieve a good source-level debugging experience :)

    Are there any instructions on how to test this out? Here's what I've
    tried so far after I applied your patches:
    
        (gdb) file ~/dev/libbpf-rs/target/bpf/runqslower.bpf.o
        Reading symbols from ~/dev/libbpf-rs/target/bpf/runqslower.bpf.o...

Try with something like:

(gdb) target sim
(gdb) sim memory-size 4Mb
(gdb) load ~/dev/libbpf-rs/target/bpf/runqslower.bpf.o
(gdb) file load ~/dev/libbpf-rs/target/bpf/runqslower.bpf.o



  reply	other threads:[~2020-07-05  0:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 12:46 Jose E. Marchesi
2020-07-03 12:46 ` [PATCH V3 1/3] gdb: support for eBPF Jose E. Marchesi
2020-07-03 12:46 ` [PATCH V3 2/3] sim: eBPF simulator Jose E. Marchesi
2020-07-03 12:46 ` [PATCH V3 3/3] sim: generated files for the " Jose E. Marchesi
2020-07-03 20:37 ` [PATCH V3 0/3] eBPF support Daniel Xu
2020-07-05  0:27   ` Jose E. Marchesi [this message]
2020-07-05  1:34     ` Simon Marchi
2020-07-05  3:12       ` Daniel Xu
2020-07-05  3:20         ` Simon Marchi
2020-07-05 10:18       ` Jose E. Marchesi

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=87y2nyq012.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=dxu@dxuuu.xyz \
    --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