DWARF->CTF enum conversion needs to be careful of sign
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.
Updated by Electric Monk over 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 2dc5cbd37af38054ac6aab88a3ecee22a13ed2eb Author: John Levon <firstname.lastname@example.org> 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 <email@example.com> Reviewed by: Andy Fiddaman <firstname.lastname@example.org> Reviewed by: Igor Kozhukhov <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>