[PATCH v2] Capture warnings when writing to the index cache

Simon Marchi simark@simark.ca
Mon Apr 8 04:23:05 GMT 2024



On 2024-03-26 11:49, Tom Tromey wrote:
>>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:
> 
> Tom> PR symtab/30837 points out a race that can occur when writing to the
> Tom> index cache: a call to ada_encode can cause a warning, which is
> Tom> forbidden on a worker thread.
> 
> Tom> This patch fixes the problem by arranging to capture any such
> Tom> warnings.
> 
> Tom> This is v2 of the patch.  It is rebased on top of some other changes
> Tom> in the same area.  v1 was here:
> 
> Tom>     https://sourceware.org/pipermail/gdb-patches/2024-February/206595.html
> 
> Tom> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30837
> 
> I'm checking this in now.
> 
> Tom

Not sure if this has been reported already, but when I build for
--host=x86_64-w64-mingw32, I get:

  CXX    gdb.o
In file included from /home/simark/src/binutils-gdb/gdb/defs.h:620,
                 from <command-line>:
/home/simark/src/binutils-gdb/gdb/utils.h:378:56: error: ignoring attributes on template argument ‘void(const char*, va_list)’ {aka ‘void(const char*, char*)’} [-Werror=ignored-attributes]
  378 | typedef gdb::function_view<void (const char *, va_list)> warning_hook_handler;
      |                                                        ^

I'm guessing that the problem is some attributes on va_list, on
mingw-w64?  I wouldn't know how to find that.

With that issue and the other one that broke the clang build, using that
function signature in a function view seems pretty fragile.  It would
perhaps be simpler for `warning_hook_handler` to be an abstract base
class with one virtual method (with the same signature as the current
warning_hook_handler).  That method could have whatever attribute it
needs, it wouldn't be a problem.

Simon


More information about the Gdb-patches mailing list