diff options
author | Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com> | 2024-01-26 02:19:52 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2024-01-31 17:30:25 -0700 |
commit | 49346fa79442ba6f0be832c2c5af4360e52f070a (patch) | |
tree | f35762eeb12117683df413823fcba61da533b6fb /gdb/complaints.c | |
parent | 3d4b08fb895826ec5f0f6c36a3be98f955aa74ea (diff) | |
download | gdb-49346fa79442ba6f0be832c2c5af4360e52f070a.zip gdb-49346fa79442ba6f0be832c2c5af4360e52f070a.tar.gz gdb-49346fa79442ba6f0be832c2c5af4360e52f070a.tar.bz2 |
Fix AIX build break.
A recent commit broke AIX build. The thread_local type defined functions
were being considered a weak symbol and hence while creating the binary these
symbols were not visible.
This patch is a fix for the same.
Diffstat (limited to 'gdb/complaints.c')
-rw-r--r-- | gdb/complaints.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gdb/complaints.c b/gdb/complaints.c index 0c46cd7..496736f 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -57,8 +57,9 @@ complaint_internal (const char *fmt, ...) va_start (args, fmt); - if (deprecated_warning_hook) - (*deprecated_warning_hook) (fmt, args); + warning_hook_handler handler = get_warning_hook_handler (); + if (handler != nullptr) + handler (fmt, args); else { gdb_puts (_("During symbol reading: "), gdb_stderr); @@ -84,15 +85,15 @@ thread_local complaint_interceptor *complaint_interceptor::g_complaint_intercept /* See complaints.h. */ complaint_interceptor::complaint_interceptor () - : m_saved_warning_hook (&deprecated_warning_hook, issue_complaint), - m_saved_complaint_interceptor (&g_complaint_interceptor, this) + : m_saved_complaint_interceptor (&g_complaint_interceptor, this), + m_saved_warning_hook (issue_complaint) { } /* A helper that wraps a warning hook. */ static void -wrap_warning_hook (void (*hook) (const char *, va_list), ...) +wrap_warning_hook (warning_hook_handler hook, ...) { va_list args; va_start (args, hook); @@ -109,8 +110,9 @@ re_emit_complaints (const complaint_collection &complaints) for (const std::string &str : complaints) { - if (deprecated_warning_hook) - wrap_warning_hook (deprecated_warning_hook, str.c_str ()); + warning_hook_handler handler = get_warning_hook_handler (); + if (handler != nullptr) + wrap_warning_hook (handler, str.c_str ()); else gdb_printf (gdb_stderr, _("During symbol reading: %s\n"), str.c_str ()); |