forked from Imagelibrary/binutils-gdb
Capture warnings when writing to the index cache
PR symtab/30837 points out a race that can occur when writing to the
index cache: a call to ada_encode can cause a warning, which is
forbidden on a worker thread.
This patch fixes the problem by arranging to capture any such
warnings.
This is v2 of the patch. It is rebased on top of some other changes
in the same area. v1 was here:
https://sourceware.org/pipermail/gdb-patches/2024-February/206595.html
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30837
This commit is contained in:
@@ -494,7 +494,8 @@ protected:
|
||||
void set (cooked_state desired_state);
|
||||
|
||||
/* Write to the index cache. */
|
||||
void write_to_cache (const cooked_index *idx) const;
|
||||
void write_to_cache (const cooked_index *idx,
|
||||
deferred_warnings *warn) const;
|
||||
|
||||
/* Helper function that does the work of reading. This must be able
|
||||
to be run in a worker thread without problems. */
|
||||
@@ -615,8 +616,10 @@ public:
|
||||
void start_reading ();
|
||||
|
||||
/* Called by cooked_index_worker to set the contents of this index
|
||||
and transition to the MAIN_AVAILABLE state. */
|
||||
void set_contents (vec_type &&vec);
|
||||
and transition to the MAIN_AVAILABLE state. WARN is used to
|
||||
collect any warnings that may arise when writing to the
|
||||
cache. */
|
||||
void set_contents (vec_type &&vec, deferred_warnings *warn);
|
||||
|
||||
/* A range over a vector of subranges. */
|
||||
using range = range_chain<cooked_index_shard::range>;
|
||||
|
||||
Reference in New Issue
Block a user