[BPF] Maintenance status and breakpoint/register questions

Qi Su via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAJTrxKCVJ4KJ0Jh_mi59nrV6cUtMxDLD7C0dp5WED2J8sKtkWA@mail.gmail.com>
Hi Jose and gdb folks,

Hope you're doing well. I've been digging into GDB's BPF target and wanted
to check a few things before I start cleaning up patches.

1. Maintenance status
The last commits touching `gdb/bpf` seem over a year old, and I haven’t
seen much recent activity. Is the port still actively maintained? Also, is
there any internal code at Oracle—docs, test cases, examples—that could be
upstreamed or shared?

2. Breakpoint decode issue (BPF_INSN_BRKPT)
BPF_INSN_BRKPT is used for breakpoint injection, but the version
requirement is BPF_XBPF, which isn’t valid in normal object files. That
causes gdb to fail decoding breakpoints. Would removing the version check
for BPF_INSN_BRKPT be acceptable, or are there side effects to be aware of?

3. gdbstub register description (r10, pc)
bpf_register_type() assigns builtin_data_ptr and builtin_func_ptr to r10
and pc without forcing width. That leads to gdb assuming 32-bit sizes,
breaking remote stub communication.

Two possible fixes:
+ Explicitly use builtin_int64 for both;
+ Enable xml register description for bpf so the stub can specify widths
directly.

Do you have a preference? I lean toward xml—it seems more future-proof—but
wasn’t sure if avoiding xml was intentional.

Let me know your thoughts. I’m happy to send patches depending on the
direction that makes sense.

Best,
Qi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.