From 0a008773c59bd80f80c02220537317c865546aca Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 29 Mar 2023 10:55:13 -0600 Subject: 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. --- gdb/thread.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gdb/thread.c') 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 ()); -- cgit v1.1