-
Notifications
You must be signed in to change notification settings - Fork 13
Signedness of DW_AT_const_value can be deduced from enumerator DW_AT_const_value #14
Copy link
Copy link
Closed
Labels
Description
The following file:
enum N{A};
template<N n>class gah{};
gah<A> meh;
When compiled with gcc (GCC) 4.9.2 20141101 (Red Hat 4.9.2-1), produces the following object file:
$ gzip -c gah.o | base64
H4sICCt6uVQAA2dhaC5vAJVVwW7TQBCdtZ02iVPTKAJaNZVcIdREwU5cRVUppBRFUCpQVFEhuFWO
s8RRa6dynKqc+gkcuXJCHPkX/oIbZw6wa6+J43hlGCWembfzZt+u1/bNs1fPBYQgMgQHMMtmZguz
+JBdV2EFTkkkBXk+oElxktADCaEHJBKfRmMIBXHOhc2gZsnBNqAcLSqIMxlldF+pyKKyoazeJY0k
JOZleV9+JKMK6VYDMV9dIR0FJCozPNci+HGlKpO2bRJS/LjyZF1YIy2rVFCoNGV9APeC8c1A4i9l
hVyDbUH0NzRt3bKCMhY27bGDm5fY95q+c0nRx7VevTU9gKPeG7XbaKht/aG+o+60jLZhtAy19hoP
1BemH+KaUVc1x5+6uDPELvZGFklNz7I713u72m5b1YaqNvEHHavRMAyAo253X62R1vXMvgD65IPj
m33ifS/0dhT5+NoHfWD6Juj9yQR0D1+Y+gD3p8Ozkft+DCw2+30PX80Nm57pDvEkqrgYuTiKSXfQ
rbHjYJd0d8c+1olUot+0zlP3+v9tI7wVsJTADzn1yTO8xTAxgf8rfxvCc8PjJ+uTuZGCxflvM/j0
+ZBg0b4th/4ryxVWF53xNeY7nPk/MX+aMf8Jh/+DeTWD/xLS9b/Lz+uk+umSkvrPOPMXGbidMf85
w1oJ3GCFUw4/8lcc/hdWoGXwb1I0UfueBqbUlmHx7MX5HzP4NBdg0Wz2QO0xwi3yL8Hi/hc4839m
56+UMT/PaJ0EP3+njYmcLmLqSiieppDiaSeP4sm3SYQvc/ACBy9y8OSuRLi8gNH9Lsf0/105+97Q
ryS1SHER5t+FpRhOVW6xvJzAI7udwKMVr8fw+HdSS9TfYXkvpje+2rjOXAz/A+79dGZwCAAA
dwgrep gives the following citation:
$ ./dwgrep/dwgrep ~/tmp/gah.o -e 'entry ?TAG_template_value_parameter @AT_const_value'
DW_AT_const_value on a DIE whose DW_AT_type is a DW_TAG_enumeration_type without DW_AT_encoding or DW_AT_type. Assuming signed.
0
However, DW_AT_type's (which is a DW_TAG_enumeration_type) children's (DW_TAG_enumerator) DW_AT_const_value's form could be inspected. In this particular case, it's DW_FORM_sdata, implying that the quantity is signed. (Note that that itself seems to be a bug, but that's not something that we can address in dwgrep.)
Besides, for values without the high bit set, the warning can be muffled, because signedness wouldn't change the value anyway. That's second part of this bugfix.
Reactions are currently unavailable