BPF in GCC
BPF in GCC
Posted Sep 16, 2020 4:01 UTC (Wed) by alison (subscriber, #63752)Parent article: BPF in GCC
"The GDB support is basic; it only handles loading a BPF program, single stepping, setting breakpoints, examining BPF registers, and listing the assembler code. Similarly, the simulator support is basic; it is integrated with GDB and most of the BPF instructions are supported so programs can run on it. There are plans to add various kinds of kernel contexts to the simulator so that different BPF program types can be run; for example, a program to be attached to a kprobe would be provided with a kprobe context in the simulator."
Presumably all the code in "BPF programs" here is userspace code. AFAIK, one must use kgdb to single-step, set breakpoints, etc. in the kernel itself. Is the intent to simulate the actual execution of the kernel in the simulator, or just to mock the returned contents from the bpf() syscall? Can the in-kernel execution of the BPF opcodes in the embedded VM can be single-stepped without kgdb? I looked at the slides, but they are much shorter than this excellent article.