Project

General

Profile

Bug #10335

mdb: fix fpcw2str()

Added by Gergő Mihály Doma 11 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
mdb - modular debugger
Start date:
2019-02-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

The fpcw2str() implementation (both in usr/src/cmd/mdb/intel/mdb/proc_amd64dep.c and in usr/src/cmd/mdb/intel/mdb/proc_ia32dep.c) have multiple problems:
  1. FPPC, FPRC and FPIC macro constants should be used as bitfield masks, meaningless to print those out because the masked bits aren't simple yes-no values
  2. To decode precision, rounding and infinity options, cw should be masked with the corresponding bit-mask first, then use equality check instead of bitwise &.

This bug found during the review of #10132: smatch fixes for MDB.

History

#1

Updated by Electric Monk 7 months ago

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

git commit 31779036e45a28bb1be446d3d65113584ccb7989

commit  31779036e45a28bb1be446d3d65113584ccb7989
Author: Doma Gergő Mihály <domag02@google.com>
Date:   2019-05-21T12:36:53.000Z

    10335 mdb: fix fpcw2str()
    Reviewed by: John Levon <john.levon@joyent.com>
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Also available in: Atom PDF