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

Hi Jose,

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.

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...

    (gdb) run
    Starting program: /home/daniel/dev/libbpf-rs/target/bpf/runqslower.bpf.o
    zsh:1: permission denied: /home/daniel/dev/libbpf-rs/target/bpf/runqslower.bpf.o
    During startup program exited with code 126.

    (gdb) info file
    Symbols from "/home/daniel/dev/libbpf-rs/target/bpf/runqslower.bpf.o".
    Local exec file:
            `/home/daniel/dev/libbpf-rs/target/bpf/runqslower.bpf.o', file type elf64-little.
            Entry point: 0x0
            0x00000000 - 0x00000000 is .text
            0x00000000 - 0x00000080 is tp_btf/sched_wakeup
            0x00000080 - 0x00000100 is tp_btf/sched_wakeup_new
            0x00000100 - 0x00000348 is tp_btf/sched_switch
            0x00000348 - 0x000003a0 is .maps
            0x000003a0 - 0x000003a4 is license

The program I'm trying to "debug" can be found here:
https://github.com/libbpf/libbpf-rs/tree/master/example

[...]

Thanks,
Daniel


  parent reply	other threads:[~2020-07-03 20:42 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 ` Daniel Xu [this message]
2020-07-05  0:27   ` [PATCH V3 0/3] eBPF support Jose E. Marchesi
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=C3XA0MPCA29A.XSNUKT5CXBYN@maharaja \
    --to=dxu@dxuuu.xyz \
    --cc=gdb-patches@sourceware.org \
    --cc=jose.marchesi@oracle.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