[PATCH 1/5] Add suitable defines to use at call and use sites
Alice Carlotti
alice.carlotti@arm.com
Wed Aug 27 13:58:03 GMT 2025
On Wed, Aug 27, 2025 at 10:52:13AM +0200, Guillaume VACHERIAS wrote:
> I've added a new prereq patch to better handle call and use sites as you've
> suggested.
>
> Changes since v1:
> - Change arguments bool to unsigned int flag.
> - Add suitable defines to handle both cases.
>
> --
>
> binutils/
>
> * dwarf.c (process_debug_ingo): Change arguments do_loc and do_types
> to single unsigned int do_flags.
> ---
...
> @@ -3902,7 +3904,8 @@ process_debug_info (struct dwarf_section * section,
> else
> {
> SAFE_BYTE_GET_AND_INC (compunit.cu_unit_type, hdrptr, 1, end_cu);
> - do_types = (compunit.cu_unit_type == DW_UT_type);
> + do_flags |= (compunit.cu_unit_type == DW_UT_type)
> + ? DO_TYPES : do_flags;
A small nit, but I think this would be clearer as:
+ do_flags |= (compunit.cu_unit_type == DW_UT_type)
+ ? DO_TYPES : 0;
or, alternatively:
+ if (compunit.cu_unit_type == DW_UT_type)
+ do_flags |= DO_TYPES;
>
> SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end_cu);
> }
> @@ -3973,7 +3976,7 @@ process_debug_info (struct dwarf_section * section,
>
> SAFE_BYTE_GET_AND_INC (compunit.cu_version, hdrptr, 2, end_cu);
>
> - this_set = find_cu_tu_set_v2 (cu_offset, do_types);
> + this_set = find_cu_tu_set_v2 (cu_offset, (do_flags & DO_TYPES));
>
> if (compunit.cu_version < 5)
> {
> @@ -3984,7 +3987,8 @@ process_debug_info (struct dwarf_section * section,
> else
> {
> SAFE_BYTE_GET_AND_INC (compunit.cu_unit_type, hdrptr, 1, end_cu);
> - do_types = (compunit.cu_unit_type == DW_UT_type);
> + do_flags |= (compunit.cu_unit_type == DW_UT_type)
> + ? DO_TYPES : do_flags;
Same here.
>
> SAFE_BYTE_GET_AND_INC (compunit.cu_pointer_size, hdrptr, 1, end_cu);
> }
More information about the Binutils
mailing list