Victor Campos
119aecb955
[DebugInfo] Emit negative DW_AT_bit_offset in explicit signed form ( #87994 )
...
Before this patch, the value of DW_AT_bit_offset, used for bitfields
before DWARF version 4, was always emitted as an unsigned integer using
the form DW_FORM_data<n>. If the value was originally a signed integer,
for instance in the case of negative offsets, it was up to debug
information consumers to re-cast it to a signed integer.
This is problematic since the burden of deciding if the value should be
read as signed or unsigned was put onto the debug info consumers: the
DWARF specification doesn't define DW_AT_bit_offset's underlying type.
If a debugger decided to interpret this attribute in the form data<n> as
unsigned, then negative offsets would be completely broken.
The DWARF specification version 3 mentions in the Data Representation
section, page 127:
> If one of the DW_FORM_data<n> forms is used to represent a signed or
unsigned integer, it can be hard for a consumer to discover the context
necessary to determine which interpretation is intended. Producers are
therefore strongly encouraged to use DW_FORM_sdata or DW_FORM_udata for
signed and unsigned integers respectively, rather than DW_FORM_data<n>.
Therefore, the proposal is to use DW_FORM_sdata, which is explicitly
signed. This is an indication to consumers that the offset must be
parsed unambiguously as a signed integer.
Finally, gcc already uses DW_FORM_sdata for negative offsets, fixing the
potential ambiguity altogether.
This patch mimics gcc's behaviour by emitting negative values of
DW_AT_bit_offset using the DW_FORM_sdata form. This eliminates any
potential misinterpretation.
One could argue that all values should use DW_FORM_sdata, but for the
sake of parity with gcc, it is safe to restrict the change to negative
values.
2024-05-13 11:14:35 +01:00
..
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-11-18 06:36:33 -08:00
2022-12-13 16:08:09 +01:00
2021-05-24 19:43:40 +02:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-01-05 15:11:47 +00:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-11-21 17:10:25 +00:00
2024-01-05 15:11:47 +00:00
2023-12-31 20:44:48 +08:00
2022-12-13 16:08:09 +01:00
2024-01-05 15:11:47 +00:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-01-21 11:37:49 +00:00
2023-07-12 12:03:44 +02:00
2023-06-05 12:55:39 -07:00
2022-10-12 12:49:17 +02:00
2021-06-01 21:59:47 -07:00
2022-10-12 12:49:17 +02:00
2022-10-12 12:49:17 +02:00
2022-10-12 12:49:17 +02:00
2023-09-01 18:25:16 -07:00
2022-10-12 12:49:17 +02:00
2021-11-24 12:30:55 +00:00
2022-10-12 12:49:17 +02:00
2022-12-13 16:08:09 +01:00
2023-06-20 16:51:05 +02:00
2022-12-22 03:31:36 -05:00
2022-12-22 03:31:36 -05:00
2023-12-12 11:32:19 +00:00
2024-01-05 15:11:47 +00:00
2021-06-15 06:25:22 +01:00
2024-04-23 09:31:20 +01:00
2022-12-09 01:04:45 +03:00
2022-12-09 01:04:45 +03:00
2023-11-30 15:29:05 +00:00
2023-11-30 15:29:05 +00:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-02-06 13:02:38 -08:00
2024-02-06 09:38:25 -08:00
2024-01-05 15:11:47 +00:00
2022-07-08 10:15:25 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-02-06 13:02:38 -08:00
2024-02-06 13:02:38 -08:00
2024-01-05 15:11:47 +00:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-02-09 18:45:20 +03:00
2024-01-05 15:11:47 +00:00
2024-01-05 15:11:47 +00:00
2024-01-05 15:11:47 +00:00
2023-12-12 11:32:19 +00:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-05-03 09:51:56 -07:00
2023-11-21 17:10:25 +00:00
2024-05-03 09:51:56 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-05-03 09:51:56 -07:00
2021-11-24 11:48:16 +00:00
2024-05-03 09:51:56 -07:00
2024-03-26 12:09:22 -07:00
2024-05-03 09:51:56 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-05-03 09:51:56 -07:00
2024-02-06 13:02:38 -08:00
2022-12-13 16:08:09 +01:00
2023-06-10 12:02:27 +08:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-10-09 05:26:58 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-09 01:04:45 +03:00
2023-01-06 10:51:02 +00:00
2023-03-29 21:01:38 +00:00
2024-02-07 12:41:32 +00:00
2022-05-05 18:18:53 +00:00
2023-01-11 15:07:11 -08:00
2021-05-24 19:43:40 +02:00
2022-09-22 17:08:41 +00:00
2022-12-13 16:08:09 +01:00
2023-12-12 11:32:19 +00:00
2024-02-06 13:02:38 -08:00
2022-12-15 02:57:08 +00:00
2023-11-18 19:17:51 +08:00
2022-12-22 03:31:36 -05:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-01-05 15:11:47 +00:00
2024-02-06 13:02:38 -08:00
2024-02-06 13:02:38 -08:00
2024-02-06 13:02:38 -08:00
2021-12-14 15:41:53 -08:00
2024-02-14 12:22:53 -08:00
2024-01-19 09:19:09 -08:00
2024-01-24 06:44:03 -08:00
2022-12-13 16:08:09 +01:00
2024-02-14 12:22:53 -08:00
2023-07-19 23:30:30 -07:00
2022-12-13 16:08:09 +01:00
2022-08-09 13:11:51 +08:00
2023-09-15 19:07:44 +01:00
2022-12-13 16:08:09 +01:00
2021-11-14 21:36:12 -08:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-06-16 00:49:59 +02:00
2022-12-13 16:08:09 +01:00
2023-07-12 12:03:44 +02:00
2023-07-12 12:03:44 +02:00
2023-07-12 12:03:44 +02:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-02-08 10:44:43 +00:00
2024-01-05 15:11:47 +00:00
2022-12-13 16:08:09 +01:00
2024-02-06 13:02:38 -08:00
2023-12-12 11:32:19 +00:00
2023-06-20 09:19:19 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2021-11-07 15:06:54 +00:00
2024-02-06 13:02:38 -08:00
2023-01-31 14:12:02 -08:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-11-09 09:51:49 +00:00
2021-06-29 09:21:00 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-05-15 16:53:52 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-10-06 16:19:43 -07:00
2023-06-16 00:49:59 +02:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-06-08 11:16:42 -07:00
2021-07-29 13:14:25 -07:00
2022-09-26 16:23:37 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-06-24 10:06:17 -07:00
2022-12-13 16:08:09 +01:00
2022-04-27 21:18:14 +00:00
2024-02-13 13:20:25 -08:00
2023-01-11 15:07:11 -08:00
2023-01-11 15:07:11 -08:00
2023-01-11 15:07:11 -08:00
2023-04-20 11:42:24 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2024-02-06 13:02:38 -08:00
2023-12-12 11:32:19 +00:00
2023-04-25 13:17:46 -07:00
2023-07-12 12:03:44 +02:00
2022-12-13 16:08:09 +01:00
2024-01-05 15:11:47 +00:00
2022-07-08 10:15:25 -07:00
2022-02-09 11:51:43 -08:00
2023-11-04 17:08:42 +00:00
2023-06-16 00:49:59 +02:00
2022-02-09 11:51:43 -08:00
2023-06-16 00:49:59 +02:00
2021-05-24 19:43:40 +02:00
2022-12-13 16:08:09 +01:00
2022-03-12 13:27:42 -08:00
2021-11-24 17:16:35 +00:00
2023-12-12 14:28:05 +00:00
2022-04-07 07:00:56 -04:00
2024-02-06 13:02:38 -08:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2021-05-24 19:43:40 +02:00
2022-03-22 16:46:47 +04:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-03-16 23:54:03 +05:30
2024-02-06 13:02:38 -08:00
2021-05-24 19:43:40 +02:00
2022-12-13 16:08:09 +01:00
2023-07-19 23:30:30 -07:00
2023-07-19 23:30:30 -07:00
2023-07-19 23:30:30 -07:00
2024-01-05 15:11:47 +00:00
2022-12-13 16:08:09 +01:00
2021-07-12 17:44:02 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-12-12 11:32:19 +00:00
2022-12-13 16:08:09 +01:00
2023-04-27 13:56:09 +01:00
2023-12-12 14:28:05 +00:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-01-20 14:47:11 +00:00
2022-12-13 16:08:09 +01:00
2024-05-03 09:51:56 -07:00
2022-12-13 16:08:09 +01:00
2024-01-05 15:11:47 +00:00
2023-01-09 08:58:33 +00:00
2024-01-05 15:11:47 +00:00
2023-01-20 14:47:11 +00:00
2023-05-19 11:29:30 +01:00
2024-04-23 11:01:54 -07:00
2024-04-23 11:01:54 -07:00
2024-04-23 11:01:54 -07:00
2022-03-22 16:46:47 +04:00
2022-12-13 16:08:09 +01:00
2023-01-09 08:58:33 +00:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-06-16 00:49:59 +02:00
2023-11-30 13:00:26 +00:00
2023-07-12 12:03:44 +02:00
2024-02-06 13:02:38 -08:00
2023-05-17 17:03:15 +02:00
2024-02-06 13:02:38 -08:00
2024-05-03 09:51:56 -07:00
2022-12-13 16:08:09 +01:00
2023-09-15 19:52:50 +00:00
2022-09-30 16:01:33 -07:00
2024-02-06 13:02:38 -08:00
2024-03-18 10:37:59 -04:00
2024-03-21 20:24:57 -04:00
2023-01-06 19:31:10 +00:00
2022-12-13 16:08:09 +01:00
2024-02-06 13:02:38 -08:00
2024-02-06 13:02:38 -08:00
2021-05-24 19:43:40 +02:00
2023-05-19 22:21:56 +08:00
2023-11-30 16:30:32 +00:00
2022-10-12 12:49:17 +02:00
2023-05-03 09:28:07 +01:00
2023-03-06 11:31:46 +04:00
2021-05-24 19:43:40 +02:00
2022-10-12 12:49:17 +02:00
2024-01-05 15:11:47 +00:00
2022-10-12 12:49:17 +02:00
2022-12-13 16:08:09 +01:00
2023-07-12 12:03:44 +02:00
2022-10-12 12:49:17 +02:00
2023-06-16 00:49:59 +02:00
2022-10-12 12:49:17 +02:00
2021-05-24 19:43:40 +02:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-10-12 12:49:17 +02:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-22 03:31:36 -05:00
2024-05-13 11:14:35 +01:00
2024-01-05 15:11:47 +00:00
2024-01-05 15:11:47 +00:00
2022-10-12 12:49:17 +02:00
2023-12-12 11:32:19 +00:00
2024-05-03 09:51:56 -07:00
2022-10-12 12:49:17 +02:00
2022-10-12 12:49:17 +02:00
2022-10-12 12:49:17 +02:00
2022-10-12 12:49:17 +02:00
2024-02-06 13:02:38 -08:00
2022-12-13 16:08:09 +01:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2022-12-13 16:08:09 +01:00
2023-09-15 19:07:44 +01:00
2022-12-13 16:08:09 +01:00
2024-02-06 13:02:38 -08:00
2024-03-18 10:37:59 -04:00
2022-12-12 22:34:49 +00:00
2022-12-13 16:08:09 +01:00
2023-03-29 21:01:38 +00:00
2021-10-12 13:02:47 -07:00
2024-01-05 15:11:47 +00:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-12-12 11:32:19 +00:00
2023-12-12 11:32:19 +00:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2022-10-12 12:49:17 +02:00
2024-05-03 09:51:56 -07:00
2024-05-03 09:51:56 -07:00
2024-01-16 17:01:01 -08:00
2022-10-12 12:49:17 +02:00
2021-11-07 15:06:54 +00:00
2024-02-06 13:02:38 -08:00
2024-02-06 13:02:38 -08:00
2024-02-06 13:02:38 -08:00
2024-02-13 13:20:25 -08:00
2024-01-05 15:11:47 +00:00
2023-12-12 11:32:19 +00:00
2024-05-03 09:51:56 -07:00
2023-06-01 00:21:00 +00:00
2023-06-01 00:21:00 +00:00
2021-05-24 19:43:40 +02:00
2022-10-12 12:49:17 +02:00
2024-01-05 15:11:47 +00:00
2023-12-12 15:49:24 +00:00
2023-12-12 15:49:24 +00:00
2023-12-12 15:49:24 +00:00
2023-12-12 15:49:24 +00:00
2023-12-12 15:49:24 +00:00
2023-12-12 15:49:24 +00:00
2023-12-12 15:49:24 +00:00
2023-05-23 20:24:55 +00:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2023-06-01 00:21:00 +00:00
2023-06-23 17:05:07 -07:00
2022-12-13 16:08:09 +01:00
2024-01-05 15:11:47 +00:00
2024-01-05 15:11:47 +00:00
2022-08-12 14:01:52 -07:00
2021-11-04 14:54:27 -07:00
2022-12-01 21:25:59 +01:00
2024-04-18 12:08:31 +01:00
2022-12-13 16:08:09 +01:00
2023-04-26 16:16:33 -07:00
2023-04-26 16:16:33 -07:00
2022-12-13 16:08:09 +01:00
2022-12-13 16:08:09 +01:00
2021-11-07 15:06:54 +00:00
2022-12-13 16:08:09 +01:00
2024-03-13 11:49:16 +01:00
2022-12-13 16:08:09 +01:00
2023-06-20 16:51:05 +02:00
2023-12-12 11:32:19 +00:00
2022-10-12 12:49:17 +02:00
2022-12-13 16:08:09 +01:00
2023-12-12 11:32:19 +00:00
2023-12-12 11:32:19 +00:00
2024-01-05 15:11:47 +00:00
2022-10-12 12:49:17 +02:00
2023-06-20 22:40:56 -07:00
2024-01-09 13:32:59 +07:00