diff options
author | Tom Tromey <tom@tromey.com> | 2023-12-03 12:40:06 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-01-18 08:20:17 -0700 |
commit | 36cde74bd8ba912604dd675bc5046c20fb8c5d68 (patch) | |
tree | 50f1e3295f5b99fd7e6b4bef797821d5b785757a /gdb/dwarf2/cooked-index.c | |
parent | 47efef8f2d8a10b63d2c6125aded1d2da69d8a04 (diff) |
Remove cooked_index_worker::start_reading
I noticed that cooked_index_worker::start_reading isn't really needed.
This patch removes it, and also removes the SCOPED_EXIT, in favor of a
direct call.
Diffstat (limited to 'gdb/dwarf2/cooked-index.c')
-rw-r--r-- | gdb/dwarf2/cooked-index.c | 32 |
1 files changed, 12 insertions, 20 deletions
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index 97a749f97e8..d5a21ee9dec 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -449,26 +449,18 @@ cooked_index_worker::start () { gdb::thread_pool::g_thread_pool->post_task ([=] () { - this->start_reading (); - }); -} - -/* See cooked-index.h. */ - -void -cooked_index_worker::start_reading () -{ - SCOPE_EXIT { bfd_thread_cleanup (); }; + try + { + do_reading (); + } + catch (const gdb_exception &exc) + { + m_failed = exc; + set (cooked_state::CACHE_DONE); + } - try - { - do_reading (); - } - catch (const gdb_exception &exc) - { - m_failed = exc; - set (cooked_state::CACHE_DONE); - } + bfd_thread_cleanup (); + }); } /* See cooked-index.h. */ @@ -520,7 +512,7 @@ cooked_index_worker::wait (cooked_state desired_state, bool allow_quit) if (m_failed.has_value ()) { - /* start_reading failed -- report it. */ + /* do_reading failed -- report it. */ exception_print (gdb_stderr, *m_failed); m_failed.reset (); return done; |