Feature #12682


want mdb-bhyve module

Added by Patrick Mooney about 2 years ago. Updated about 2 years ago.

mdb - modular debugger
Start date:
Due date:
% Done:


Estimated time:
Gerrit CR:


As part of porting bhyve to illumos, a module was written for mdb in order to inspect and debug a bhyve guest.
This represents the upstreaming effort for the consolidated commits to implement the change.

Downstream commits included in the change:
- OS-7768 illumos-joyent needs smatch fixes
- OS-7508 mdb: assertion tripped in libvmm when bhyve VM halts while mdb is attached
- OS-7519 mdb: bhyve target can attach before the first vCPU is configured
- OS-7441 mdb: clean up ::sysregs duplication
- OS-7528 update bhyve pkg manifest from OmniOS
- OS-7572 bhyve: stop shipping and
- OS-7464 uninitialized boolean from OS-7419 is too truthy
- OS-7463 build broken after OS-6969 integration
- OS-7408 want native libvmm (fix deps)
- OS-6969 want mdb module for bhyve

Actions #1

Updated by Patrick Mooney about 2 years ago

This change has been in SmartOS and OmniOS for over a year now. When initially merged into SmartOS, Hans mentioned his testing efforts:

I tested this by controlling a VM running Ubuntu 17.10. I have verified that I can single step from the first instruction of the UEFI ROM in real mode through the initial setup for protected mode and later into long mode. I have verified that in each situation the register dumps look the way they are supposed to, that the right disassembler is chosen based on the CS attributes, and that disassembling and stack tracing uses the right segments when appropriate. I've also verified that stopping/resuming VM execution and accessing memory and register contents still work as expected once the OS was booted, and that the OS wasn't doing anything unexpected while single-stepping through it's idle code.

With the upstreaming patch applied, I booted up a guest instance and checked similar functionality:
- The guest remained paused when started with the -d flag
- I was able to single step through instructions, starting with the bootloader
- When released with :c, the guest booted up fine
- I could observe system state via dcmds like ::sysregs

Actions #2

Updated by Patrick Mooney about 2 years ago

And additional note on testing: After merging this into SmartOS, no regressions were noted in unrelated mdb operations. The minor restructuring in the patch does not appear to have adversely effected other unrelated operations.

Actions #3

Updated by Patrick Mooney about 2 years ago

  • Description updated (diff)
Actions #4

Updated by Electric Monk about 2 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit 9c3024a3457d2d1269be18124a1ac69e33000da7

commit  9c3024a3457d2d1269be18124a1ac69e33000da7
Author: Hans Rosenfeld <>
Date:   2020-05-22T18:59:54.000Z

    12682 want mdb-bhyve module
    Portions contributed by: Andy Fiddaman <>
    Portions contributed by: John Levon <>
    Portions contributed by: Patrick Mooney <>
    Reviewed by: John Levon <>
    Approved by: Dan McDonald <>


Also available in: Atom PDF