Project

General

Profile

Feature #4069

mdb should support embedded dmods in core dumps

Added by Robert Mustacchi almost 7 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
mdb - modular debugger
Start date:
2013-08-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When working with other pieces of software that want dmods there is a challenge of making sure that we always have the right version of the dmod to debug the resulting application. There is tension between shipping it in illumos, having the most recent version, and making sure that you have that around when you're debugging disparate versions. In these cases one solution is to have the dmod itself embedded in the library or executable that we care about in such a way that when the binary core dumps it will be in the dump. A simple solution to this is using elfwrap(1) to create a .o of the mdb so which can then be linked into the resulting application.

We construct a contract that if there is a symbol like mdb_<module>_start then mdb will notice it on startup and write it out to a temporary file and load it up. Similarly if someone issues a ::load we'll iterate over the symbol table of the target and use this same method. If a ::load is executed with the full path to a module, then this will be bypassed and the file will be loaded from the file system. Similarly if we fail to load it from the binary then it will be found in the program itself.

History

#1

Updated by Robert Mustacchi 5 months ago

  • Status changed from New to Closed

Due to the security issues that are inherent in this, we haven't implemented this at this time.

Also available in: Atom PDF