Project

General

Profile

Bug #9864

DWARF->CTF enum conversion needs to be careful of sign

Added by John Levon 10 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2018-10-03
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Equivalent of https://smartos.org/bugview/OS-7279 but for the old tools

Previously, our enumeration conversion simply used ctf_dwarf_signed(DW_AT_const_value. However, with newer GCC versions, this will produce - for example - -32768 when the real enum value is 32768.

Instead, we should check ctf_dwarf_unsigned() first - this fails for negative-valued enums, so we will end up with the right value whether it's positive or negative.


Related issues

Related to illumos gate - Feature #9996: use GCC 7 as default primary compilerClosed2018-11-21

Actions

History

#1

Updated by John Levon 10 months ago

One manifestation of this is ddi_hp_cn_state_t : all the enum values should be positive

#2

Updated by John Levon 8 months ago

  • Related to Feature #9996: use GCC 7 as default primary compiler added
#3

Updated by Electric Monk 6 months ago

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

git commit 2dc5cbd37af38054ac6aab88a3ecee22a13ed2eb

commit  2dc5cbd37af38054ac6aab88a3ecee22a13ed2eb
Author: John Levon <john.levon@joyent.com>
Date:   2019-01-18T02:17:01.000Z

    9312 ctf: be less clever about skipping 'extern' variables declarations
    9864 DWARF->CTF enum conversion needs to be careful of sign
    Reviewed by: Toomas Soome <tsoome@me.com>
    Reviewed by: Andy Fiddaman <af@citrus-it.net>
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF