diff options
author | Paul Pluzhnikov <ppluzhnikov@google.com> | 2009-07-16 19:47:43 +0000 |
---|---|---|
committer | Paul Pluzhnikov <ppluzhnikov@google.com> | 2009-07-16 19:47:43 +0000 |
commit | 456b0e2407650e5149308fb3fe21f750f9e32e1d (patch) | |
tree | 527cf43ca90596d322e134f32ed803f5c6554a46 | |
parent | 0aaaf7c3ef758c804f78ecab8dc36f247c4651d9 (diff) | |
download | gdb-456b0e2407650e5149308fb3fe21f750f9e32e1d.zip gdb-456b0e2407650e5149308fb3fe21f750f9e32e1d.tar.gz gdb-456b0e2407650e5149308fb3fe21f750f9e32e1d.tar.bz2 |
2007-07-16 Paul Pluzhnikov <ppluzhnikov@google.com>
* linux-thread-db.c (thread_db_find_new_threads_silently):
New function.
(try_thread_db_load_1): Call it.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/linux-thread-db.c | 27 |
2 files changed, 32 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ed766f8..3935d86 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2007-07-16 Paul Pluzhnikov <ppluzhnikov@google.com> + + * linux-thread-db.c (thread_db_find_new_threads_silently): + New function. + (try_thread_db_load_1): Call it. + 2009-07-15 Doug Evans <dje@google.com> Code reorg in preparation for adding comdat types support. diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index cea4541..035d3c2 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -588,6 +588,25 @@ enable_thread_event_reporting (void) } } +/* Same as thread_db_find_new_threads_1, but silently ignore errors. */ + +static void +thread_db_find_new_threads_silently (ptid_t ptid) +{ + volatile struct gdb_exception except; + + TRY_CATCH (except, RETURN_MASK_ERROR) + { + thread_db_find_new_threads_1 (ptid); + } + + if (except.reason < 0 && info_verbose) + { + exception_fprintf (gdb_stderr, except, + "Warning: thread_db_find_new_threads_silently: "); + } +} + /* Lookup a library in which given symbol resides. Note: this is looking in GDB process, not in the inferior. Returns library name, or NULL. */ @@ -705,7 +724,13 @@ try_thread_db_load_1 (struct thread_db_info *info) push_target (&thread_db_ops); enable_thread_event_reporting (); - thread_db_find_new_threads_1 (inferior_ptid); + + /* There appears to be a bug glibc-2.3.6: call to td_thr_get_info fails + with TD_ERR for statically linked executables if td_thr_get_info is + called before glibc has initialized itself. Silently ignore such + errors. */ + + thread_db_find_new_threads_silently (inferior_ptid); return 1; } |