From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp2120.oracle.com (aserp2120.oracle.com [141.146.126.78]) by sourceware.org (Postfix) with ESMTPS id CC20D3858D39 for ; Sun, 5 Jul 2020 00:27:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CC20D3858D39 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0650Horm086885; Sun, 5 Jul 2020 00:27:11 GMT Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by aserp2120.oracle.com with ESMTP id 322kv61kd0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Sun, 05 Jul 2020 00:27:11 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0650Cm6c155547; Sun, 5 Jul 2020 00:27:10 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 3233hp96k3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 05 Jul 2020 00:27:10 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0650R9l5020869; Sun, 5 Jul 2020 00:27:09 GMT Received: from termi.oracle.com (/77.180.183.239) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 04 Jul 2020 17:27:08 -0700 From: "Jose E. Marchesi" To: "Daniel Xu" Cc: Subject: Re: [PATCH V3 0/3] eBPF support References: Date: Sun, 05 Jul 2020 02:27:05 +0200 In-Reply-To: (Daniel Xu's message of "Fri, 03 Jul 2020 13:37:40 -0700") Message-ID: <87y2nyq012.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9672 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007050000 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9672 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 phishscore=0 spamscore=0 priorityscore=1501 clxscore=1011 impostorscore=0 mlxscore=0 adultscore=0 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007050000 X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2020 00:27:16 -0000 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