Bug #9091

MDB smart-write

Added by Serapheim Dimitropoulos 8 months ago. Updated 8 months ago.

Status:ClosedStart date:2018-02-10
Priority:NormalDue date:
Assignee:Serapheim Dimitropoulos% Done:

100%

Category:mdb - modular debugger
Target version:-
Difficulty:Medium Tags:needs-triage

Description

Currently, if you want to write to a kernel tunable using
mdb, you need to use the /Z or /W flags to write 8 or 4
bytes respectively. If you use the wrong one, you will either
overwrite only part of the tunable, or overrun the end of the
tunable and zero out the next 4 bytes of memory. That second
option in particular can be disastrous. Given that MDB knows
the size of the tunables because it has CTF data, it would be
nice if MDB supported a "smart write" format string that
selected the size of the write based on the size of the thing
being written to. It should fail or require a size be specified
if we're writing to an area without a specific size.

History

#1 Updated by Electric Monk 8 months ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit 3d580eda65b7c5ad75a73a93dceeebddfae06ec9

commit  3d580eda65b7c5ad75a73a93dceeebddfae06ec9
Author: Serapheim Dimitropoulos <serapheim.dimitro@delphix.com>
Date:   2018-02-15T23:07:01.000Z

    9091 MDB smart-write
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Paul Dagnelie <pcd@delphix.com>
    Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom