diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-29 10:55:13 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-01-08 18:40:22 -0700 |
commit | 0a008773c59bd80f80c02220537317c865546aca (patch) | |
tree | 14036ebe5238352b58bd9f4466f92cda2b058aae /gdb/thread.c | |
parent | c83a2802182b3da5d1080425ded0700b3af27f6b (diff) | |
download | binutils-0a008773c59bd80f80c02220537317c865546aca.zip binutils-0a008773c59bd80f80c02220537317c865546aca.tar.gz binutils-0a008773c59bd80f80c02220537317c865546aca.tar.bz2 |
Lazy language setting
When gdb starts up with a symbol file, it uses the program's "main" to
decide the "static context" and the initial language. With background
DWARF reading, this means that gdb has to wait for a significant
amount of DWARF to be read synchronously.
This patch introduces lazy language setting. The idea here is that in
many cases, the prompt can show up early, making gdb feel more
responsive.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r-- | gdb/thread.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/gdb/thread.c b/gdb/thread.c index bd3fe85..f03a60c 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -1438,13 +1438,13 @@ scoped_restore_current_thread::restore () && target_has_stack () && target_has_memory ()) restore_selected_frame (m_selected_frame_id, m_selected_frame_level); - - set_language (m_lang); } scoped_restore_current_thread::~scoped_restore_current_thread () { - if (!m_dont_restore) + if (m_dont_restore) + m_lang.dont_restore (); + else restore (); } @@ -1452,8 +1452,6 @@ scoped_restore_current_thread::scoped_restore_current_thread () { m_inf = inferior_ref::new_reference (current_inferior ()); - m_lang = current_language->la_language; - if (inferior_ptid != null_ptid) { m_thread = thread_info_ref::new_reference (inferior_thread ()); |