Hi Aaron,

On Sun, 2025-01-19 at 22:20 -0500, Aaron Merey wrote:
> From: Heather McIntyre <h...@rice.edu>
> 
>       * tests/.gitignore: Add eu_search_macros.sh
>       * tests/Makefile.am: Add eu_search_macros,
>       run-eu-search-macros.sh.
>       * tests/eu_search_macros.c: New file.
>       * tests/run-eu-search-macros.sh: New file.

Nice. Looks good. One nitpick and a question about the actual test
below.

> @@ -877,7 +877,9 @@ elf_print_reloc_syms_LDADD = $(libelf)
>  cu_dwp_section_info_LDADD = $(libdw)
>  declfiles_LDADD = $(libdw)
>  eu_search_cfi_LDFLAGS = $(if $(filter undefined,$(origin 
> USE_LOCKS)),-pthread) $(AM_LDFLAGS)
> +eu_search_macros_LDFLAGS = $(if $(filter undefined,$(origin 
> USE_LOCKS)),-pthread) $(AM_LDFLAGS)
>  eu_search_cfi_LDADD = $(libeu) $(libelf) $(libdw)
> +eu_search_macros_LDADD = $(libdw)

Same nitpick as for eu-search-cfi, you can probably just
unconditionally add -pthread. And I would keep the LDFLAGS and LDADD
for the same program together. But certainly not showstoppers.

> +static void *thread_work (void *arg __attribute__ ((unused)))
> +{
> +  Dwarf_Die cudie_mem, *cudie = dwarf_offdie (dbg, cuoff, &cudie_mem);
> +  for (ptrdiff_t off = DWARF_GETMACROS_START;
> +       (off = dwarf_getmacros (cudie, mac, dbg, off));)
> +    {
> +      if (off != 0)
> +     {
> +       puts (dwarf_errmsg (dwarf_errno ()));
> +       break;

Don't you want to exit/error here to indicate failure?

> +     }
> +    }
> +
> +  return NULL;
> +}

Reply via email to