Project

General

Profile

Actions

Feature #11264

closed

tid::errno would be handy in mdb

Added by Jason King over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
mdb - modular debugger
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

Description

Upstream of Joyent OS-7525:

If one wishes to see the current value of errno of a thread (for example because the value tripped an assert and ASSERT3S or VERIFY3S wasn't used to capture the value in the panic message), it's a bit tedious:

For historical reasons, TID 1's errno value is stored in a libc global variable errno. For TID > 1, their errno value is stored in curthread->ul_errno. In addition, for every TID, curthread->ul_errnop points to the address storing the threads errno value (abstracting away this difference). One must remember all of this to get meaningful values, and the mdb syntax that would be needed to consistently get the value would be rather complicated. It would be simpler to have an mdb dcmd that takes care of all of this for us.

Actions #1

Updated by Electric Monk over 4 years ago

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

git commit 07188943efdbeedd24142a14db7384af1478ba54

commit  07188943efdbeedd24142a14db7384af1478ba54
Author: Jason King <jason.king@joyent.com>
Date:   2019-06-21T14:51:11.000Z

    11264 tid::errno would be handy in mdb
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Andy Fiddaman <andy@omniosce.org>
    Approved by: Gordon Ross <gwr@nexenta.com>

Actions

Also available in: Atom PDF