debugging on xen

Xen greatly facilitates debugging of OS kernels and modules by allowing
source level debug. Allow me to introduce debuggers I wrote up late 2007,
mostly from scratch, for xen. The first is gdbsx which was just recently
merged into xen unstable branch. The second is kdb, whose primary goal
is to allow debug of the hypervisor and also dom0.  kdb is somewhat
a misnomer. I started with porting kdb from linux but later found it
easier and quicker to just write one up from scratch. However, I credit
linux kdb with allowing me to learn how kernel debuggers work.
gdbsx is intended for debugging non privileged guests. It runs on
dom0 and communicates to the hypervisor directly. It is fairly light
weight. By adding little support in xen for external debuggers, I was
able to keep it fairly simple. Once started on dom0, it talks to remote
gdb and allows for standard debugging of any guest, PV or HVM, 32 or 64
bits. It resides in tools/debugger/gdbsx directory, and the README gives
details on usage. It’s as simple as building and installing a hypervisor
with gdbsx support, and then just running gdbsx on dom0.  When attached to
guest, it pauses the guest, does initial setup and is ready for debug. It
accepts commands from remote gdb, and liaisons between the remote gdb and
xen.
kdb is an assembly level debugger intended for debug of the hypervisor
and dom0, but can also be used to debug non-priviliged guests also. It finds
the basic hypervisor symbols like function names in it, and shows
meaningful stacks etc. By providing some hints on basic symbol table
for guests, it can serve to be an assembly level debugger for guests
also. kdb provides fairly large variety of commands, from standard
commands to being able to examine domain/vcpu structs, get info on
pages, looking up into m2p/p2m tables, etc…  It current resides in an
external tree at http://xenbits.xensource.com/ext/debuggers.hg. The
README in the xen/kdb sub directory provides details on usage.
I hope this helps engineers with their development and support of all of non-user level software on xen. Feedback always welcome, please post to xen-devel list.
Mukesh Rathor

Read more

Welcome Honda to the Xen Project Board
12/09/2024

We're excited to announce our newest Advisory Board Member Honda, to Xen Project. Since its foundation, Honda has been committed to "creating a society that is useful to people" by utilizing its technologies and ideas. Honda also focuses on environmental responsiveness and traffic safety, and continue

Say hello to our new website
12/05/2024

Hello Xen Community, You may have noticed something different... We've refreshed our existing website! Why did we do this? Well, all these new changes are part of an ongoing effort to increase our visibility and make it easier to find information on pages. We know how important it

Xen Project Announces Performance and Security Advancements with Release of 4.19
08/05/2024

New release marks significant enhancements in performance, security, and versatility across various architectures.  SAN FRANCISCO – July 31st, 2024 – The Xen Project, an open source project under the Linux Foundation, is proud to announce the release of Xen Project 4.19. This release marks a significant milestone in enhancing performance, security,

Upcoming Closure of Xen Project Colo Facility
07/10/2024

Dear Xen Community, We regret to inform you that the Xen Project is currently experiencing unexpected changes due to the sudden shutdown of our colocated (colo) data center facility by Synoptek. This incident is beyond our control and will impact the continuity of OSSTest (the gating Xen Project CI loop)