diff options
Diffstat (limited to 'nptl_db')
49 files changed, 95 insertions, 468 deletions
diff --git a/nptl_db/ChangeLog.old b/nptl_db/ChangeLog.old deleted file mode 100644 index 6e74f3ecbb..0000000000 --- a/nptl_db/ChangeLog.old +++ /dev/null @@ -1,347 +0,0 @@ -This file describes changes to the nptl_db/ subdirectory prior to 2014-03-03. -Later nptl_db/ changes go into the top-level ChangeLog file, not here. - - - -2014-02-26 Joseph Myers <joseph@codesourcery.com> - - * Makefile: Include Makeconfig immediately after defining subdir. - -2014-02-21 Joseph Myers <joseph@codesourcery.com> - - * Makefile ($(objpfx)db-symbols.out): Use - $(evaluate-test). - -2013-05-31 Joseph Myers <joseph@codesourcery.com> - - * Makefile ($(objpfx)libthread_db.so): Remove dependencies on - libc. - -2013-05-16 Ryan S. Arnold <rsa@linux.vnet.ibm.com> - - * db_info.c: Add missing #include <stdint.h> due to uint64_t or - uint32_t usage. - * fetch-value.c: Likewise. - * td_ta_clear_event.c: Likewise. - * td_ta_set_event.c: Likewise. - * td_ta_tsd_iter.c: Likewise. - * td_thr_clear_event.c: Likewise. - * td_thr_get_info.c: Likewise. - * td_thr_set_event.c: Likewise. - * td_thr_tsd.c: Likewise. - -2013-01-02 Joseph Myers <joseph@codesourcery.com> - - * All files with FSF copyright notices: Update copyright dates - using scripts/update-copyrights. - -2013-01-01 Joseph Myers <joseph@codesourcery.com> - - * td_ta_thr_iter.c: Reformat copyright notice. - * td_thr_validate.c: Likewise. - -2012-11-23 Mike Frysinger <vapier@gentoo.org> - - * Makefile ($(objpfx)db-symbols.out): Change readelf to $(READELF). - -2012-10-08 Jonathan Nieder <jrnieder@gmail.com> - - [BZ #14661] - * Makefile ($(objpfx)db-symbols.out): Force C locale when running - readelf -s. - -2012-03-07 Ulrich Drepper <drepper@gmail.com> - - * Makefile (distribute): Remove variable. - -2011-09-15 Andreas Schwab <schwab@redhat.com> - - * thread_dbP.h: Include <list.h> - -2009-08-23 Roland McGrath <roland@redhat.com> - - * td_ta_map_lwp2thr.c (__td_ta_lookup_th_unique): Move ta_ok check - and LOG call back to ... - (td_ta_map_lwp2thr): ... here. - Reported by Maciej W. Rozycki <macro@codesourcery.com>. - -2009-05-25 Aurelien Jarno <aurelien@aurel32.net> - - [BZ #10200] - * db-symbols.awk: Use the last field for the symbol name instead - of the 8th one. - -2009-03-19 Roland McGrath <roland@redhat.com> - - * td_symbol_list.c (DB_LOOKUP_NAME, DB_LOOKUP_NAME_TH_UNIQUE): - Use STRINGIFY macro in place of #argument. - -2009-02-27 Roland McGrath <roland@redhat.com> - - * td_symbol_list.c (symbol_list_arr): Move initializer guts to ... - * db-symbols.h: ... here, new file. - * db-symbols.awk: New file. - * Makefile (distribute): Add them. - ($(objpfx)db-symbols.out): New target. - (tests): Depend on it. - ($(objpfx)db-symbols.v.i): New dependent rule. - -2009-02-06 Ulrich Drepper <drepper@redhat.com> - - * td_thr_get_info.c (td_thr_get_info): Initialize schedpolicy in - the special case [Coverity CID 251]. - -2008-03-25 Roland McGrath <roland@redhat.com> - - [BZ #5983] - * structs.def: Add pid field of struct pthread. - * td_ta_thr_iter.c (iterate_thread_list): Take new arg MATCH_PID. - If a thread's pid does not match nor is < 0 while its tid matches - nor is < 0 and equal to -MATCH_PID, ignore it. - * td_thr_validate.c (td_thr_validate): Validate thread's pid/tid. - -2007-05-16 Roland McGrath <roland@redhat.com> - - * td_thr_get_info.c: Fake the results for TH->th_unique == 0. - * td_thr_validate.c: Likewise. - * td_thr_setgregs.c: Likewise. - * td_thr_setfpregs.c: Likewise. - * td_thr_getgregs.c: Likewise. - * td_thr_getfpregs.c: Likewise. - * td_thr_tlsbase.c: Likewise. - - * structs.def: Add DB_VARIABLE (__nptl_initial_report_events). - * db_info.c: Add necessary declaration. - * td_thr_event_enable.c: Set __nptl_initial_report_events too. - - * td_ta_thr_iter.c (iterate_thread_list): Make FAKE_EMPTY bool. - Use th_unique=0 in fake descriptor before initialization. - - * td_ta_map_lwp2thr.c (__td_ta_lookup_th_unique): New function, broken - out of ... - (td_ta_map_lwp2thr): ... here, call it. But don't before __stack_user - is initialized, then fake a handle with th_unique=0. - * thread_dbP.h: Declare it. - -2006-10-26 Pete Eberlein <eberlein@us.ibm.com> - - * nptl_db/db_info.c [TLS_DTV_AT_TP]: Fixed size init for dtvp - to sizeof a pointer, instead of sizeof the union. - -2006-10-27 Ulrich Drepper <drepper@redhat.com> - - * structs.def: USE_TLS support is now default. - -2006-02-03 Roland McGrath <roland@redhat.com> - - * structs.def: Add a descriptor for pointer.val field of dtv_t. - * td_thr_tlsbase.c (td_thr_tlsbase): Extract pointer.val field from - DTV slot. - -2004-09-09 Roland McGrath <roland@redhat.com> - - * td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Don't abort if inferior's - descriptor is bogus. - -2004-05-27 Roland McGrath <roland@redhat.com> - - * td_thr_validate.c: When we find no threads and the inferior appears - uninitialized, validate the main thread as a special case. - -2004-05-01 Jakub Jelinek <jakub@redhat.com> - - * thread_dbP.h (LOG): Use write instead of __libc_write. - -2004-04-03 Ulrich Drepper <drepper@redhat.com> - - * td_ta_set_event.c (td_ta_set_event): Initialize copy to avoid - warnings. - - * td_ta_thr_iter.c (td_ta_thr_iter): Initialize list to avoid warning. - * td_ta_clear_event.c (td_ta_clear_event): Initialize eventmask to - avoid warning. - * td_ta_set_event.c (td_ta_set_event): Likewise. - -2004-03-24 Roland McGrath <roland@redhat.com> - - * fetch-value.c (_td_locate_field): Cast DB_DESC_OFFSET to int32_t. - * thread_dbP.h (DB_DESC_OFFSET): Remove cast from definition. - -2004-03-13 Jakub Jelinek <jakub@redhat.com> - - * db_info.c: Don't use TLS_TP_OFFSET in the #if, but - TLS_TCB_SIZE == 0 ?: in the DESC macro. - -2004-03-12 Roland McGrath <roland@redhat.com> - - * db_info.c [TLS_DTV_AT_TP && TLS_TP_OFFSET > 0] - (_thread_db_pthread_dtvp): Define differently for this case (PowerPC). - -2003-12-11 Ulrich Weigand <uweigand@de.ibm.com> - - * db_info.c (REGISTER): Add bit size of thread register as second - parameter to REGISTER macro. - -2003-12-02 Roland McGrath <roland@redhat.com> - - * thread_dbP.h (DB_FUNCTION): New macro. - * structs.def: Use it for __nptl_create_event and __nptl_death_event. - * db_info.c (DB_FUNCTION): New macro. - * td_symbol_list.c (DB_FUNCTION): New macro, prepend "." to symbol - name under [HAVE_ASM_GLOBAL_DOT_NAME]. - (td_lookup) [HAVE_ASM_GLOBAL_DOT_NAME]: If lookup fails with PS_NOSYM - and name starts with a dot, try it without the dot. - -2003-09-08 Roland McGrath <roland@redhat.com> - - * td_thr_get_info.c (td_thr_get_info): Cast th_unique to thread_t. - -2003-08-22 Roland McGrath <roland@redhat.com> - - * fetch-value.c (_td_check_sizeof, _td_locate_field): Return - TD_NOCAPAB for PS_NOSYM, instead of vanilla TD_ERR. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Return TD_NOAPLIC when - DB_GET_FIELD returns TD_NOCAPAB. - - * thread_db.h (td_thr_tls_get_addr): Use psaddr_t in signature. - * structs.def [USE_TLS]: Add DB_STRUCT_FIELD (link_map, l_tls_modid). - * db_info.c (link_map): Typedef it. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Rewritten. - -2003-08-14 Roland McGrath <roland@redhat.com> - - * thread_dbP.h: Mostly rewritten with many new macros and decls. - * td_ta_new.c (td_ta_new): Don't cache a lot of symbol values. - * structs.def: New file. - * db_info.c: New file. - * td_symbol_list.c (symbol_list_arr): Define with structs.def macros. - * td_ta_clear_event.c: Rewritten. - * td_ta_event_addr.c: Rewritten. - * td_ta_event_getmsg.c: Rewritten. - * td_ta_get_nthreads.c: Rewritten. - * td_ta_map_lwp2thr.c: New file. - * td_ta_set_event.c: Rewritten. - * td_ta_thr_iter.c: Rewritten. - * td_ta_tsd_iter.c: Rewritten. - * td_thr_clear_event.c: Rewritten. - * td_thr_event_enable.c: Rewritten. - * td_thr_event_getmsg.c: Rewritten. - * td_thr_get_info.c: Rewritten. - * td_thr_getfpregs.c: Rewritten. - * td_thr_getgregs.c: Rewritten. - * td_thr_set_event.c: Rewritten. - * td_thr_setfpregs.c: Rewritten. - * td_thr_setgregs.c: Rewritten. - * td_thr_tlsbase.c: Rewritten. - * td_thr_tsd.c: Rewritten. - * td_thr_validate.c: Rewritten. - * Makefile (distribute): Add them. - * fetch-value.c: New file. - * Makefile (libthread_db-routines): Add it. - - * thread_db.h (td_err_e): Comment fix. - -2003-08-05 Roland McGrath <roland@redhat.com> - - * thread_dbP.h (td_lookup): Add attribute_hidden to decl. - -2003-08-04 Roland McGrath <roland@redhat.com> - - * td_ta_clear_event.c (td_ta_clear_event): Fix sizes in ps_* calls. - -2003-06-23 Roland McGrath <roland@redhat.com> - - * proc_service.h: Cosmetic and comment fixes. - -2003-06-19 Roland McGrath <roland@redhat.com> - - * td_thr_event_enable.c (td_thr_event_enable): Use proper type `bool' - for value written into inferior's `report_events'. - -2003-03-18 Roland McGrath <roland@redhat.com> - - * td_thr_event_getmsg.c (td_thr_event_getmsg): Splice the thread out - of the ->nextevent linkage. - - * td_ta_event_getmsg.c (td_ta_event_getmsg): Runtime error instead of - assert for reading TD_EVENT_NONE. Clear the event buffer after - reading it. Add a sanity check for foo->nextevent = foo. - -2003-03-15 Roland McGrath <roland@redhat.com> - - * thread_db.h (td_err_e): Add TD_NOTLS and TD_TLSDEFER. - (td_thr_tlsbase): Declare it. - * td_thr_tlsbase.c: New file. - * Makefile (libthread_db-routines): Add it. - * Versions (libthread_db: GLIBC_2.3.3): New set, add td_thr_tlsbase. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Use td_thr_tlsbase. - -2003-03-14 Roland McGrath <roland@redhat.com> - - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Use `header.' prefix. - -2003-03-10 Roland McGrath <roland@redhat.com> - - * td_ta_thr_iter.c (iterate_thread_list): Don't use `header.data.' - prefix for `struct pthread' members. - * td_thr_validate.c (check_thread_list): Likewise. - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Likewise. - -2003-03-03 Roland McGrath <roland@redhat.com> - - * td_thr_tls_get_addr.c (td_thr_tls_get_addr): Handle TLS_DTV_AT_TP. - -2003-02-15 Ulrich Drepper <drepper@redhat.com> - - * td_symbol_list.c: New symbol name for SYM_PTHREAD_NTHREADS. - -2003-01-07 Jakub Jelinek <jakub@redhat.com> - - * td_ta_event_getmsg.c: Include assert.h. - --2003-01-05 Ulrich Drepper <drepper@redhat.com> - - * Makefile (libthread_db.so-no-z-defs): Define. - -2003-01-03 Roland McGrath <roland@redhat.com> - - * td_thr_setgregs.c (td_thr_setgregs): *_BIT -> *_BITMASK - * td_thr_setfpregs.c (td_thr_setfpregs): Likewise. - * td_thr_get_info.c (td_thr_get_info): Likewise. - * td_thr_getgregs.c (td_thr_getgregs): Likewise. - * td_thr_getfpregs.c (td_thr_getfpregs): Likewise. - * td_ta_thr_iter.c (iterate_thread_list): Likewise. - -2002-12-12 Roland McGrath <roland@redhat.com> - - * td_ta_thr_iter.c (iterate_thread_list): Handle special case of - uninitialized __stack_user (zeros), hard-wire just the main thread. - - * td_thr_get_info.c (td_thr_get_info): Fix ti_lid initialization. - -2002-12-06 Roland McGrath <roland@redhat.com> - - * td_ta_event_getmsg.c (td_ta_event_getmsg): Write the NEXT pointer - into the inferior's __pthread_last_event variable, not a word from - an inferior address used in the parent. Pass the address of a - null word to ps_pdwrite, not a null pointer. - -2002-12-04 Roland McGrath <roland@redhat.com> - - * td_thr_get_info.c (td_thr_get_info): ti_tid is pthread_t, not a PID. - - * thread_db.h (td_thrinfo_t): Comment fix. - - * td_ta_map_lwp2thr.c: Moved to ../nptl/sysdeps/i386/. - -2002-12-04 Ulrich Drepper <drepper@redhat.com> - - * td_ta_thr_iter.c (iterate_thread_list): At end of iteration read - pointer to the next element from inferior. - -2002-12-02 Roland McGrath <roland@redhat.com> - - * td_symbol_list.c (symbol_list_arr): pthread_keys -> __pthread_keys - - * td_ta_map_lwp2thr.c (td_ta_map_lwp2thr): Fetch inferior registers to - see its %gs value, not our own. diff --git a/nptl_db/Makefile b/nptl_db/Makefile index 849a73faa1..046840ec3f 100644 --- a/nptl_db/Makefile +++ b/nptl_db/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2016 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # This file is part of the GNU C Library. # The GNU C Library is free software; you can redistribute it and/or @@ -26,7 +26,7 @@ nptl_db-version = 1.0 extra-libs = libthread_db extra-libs-others := $(extra-libs) -headers = thread_db.h sys/procfs.h +headers = proc_service.h thread_db.h sys/procfs.h libthread_db-routines = td_init td_log td_ta_new td_ta_delete \ td_ta_get_nthreads td_ta_get_ph \ diff --git a/nptl_db/db-symbols.h b/nptl_db/db-symbols.h index 226e9019dd..e2f7cf6306 100644 --- a/nptl_db/db-symbols.h +++ b/nptl_db/db-symbols.h @@ -1,5 +1,5 @@ /* List of symbols in libpthread examined by libthread_db. - Copyright (C) 2009-2016 Free Software Foundation, Inc. + Copyright (C) 2009-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl_db/db_info.c b/nptl_db/db_info.c index c33b1cf616..7f23cf4620 100644 --- a/nptl_db/db_info.c +++ b/nptl_db/db_info.c @@ -1,7 +1,7 @@ /* This file is included by pthread_create.c to define in libpthread all the magic symbols required by libthread_db. - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl_db/fetch-value.c b/nptl_db/fetch-value.c index 6d2511aacc..8514898e2b 100644 --- a/nptl_db/fetch-value.c +++ b/nptl_db/fetch-value.c @@ -1,5 +1,5 @@ /* Helper routines for libthread_db. - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl_db/proc_service.h b/nptl_db/proc_service.h index c1c139f28e..1b88982f00 100644 --- a/nptl_db/proc_service.h +++ b/nptl_db/proc_service.h @@ -1,5 +1,5 @@ /* Callback interface for libthread_db, functions users must define. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -16,9 +16,14 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ +#ifndef _PROC_SERVICE_H +#define _PROC_SERVICE_H 1 + /* The definitions in this file must correspond to those in the debugger. */ #include <sys/procfs.h> +__BEGIN_DECLS + /* Functions in this interface return one of these status codes. */ typedef enum { @@ -64,7 +69,7 @@ extern pid_t ps_getpid (struct ps_prochandle *); /* Fetch the special per-thread address associated with the given LWP. This call is only used on a few platforms (most use a normal register). The meaning of the `int' parameter is machine-dependent. */ -extern ps_err_e ps_get_thread_area (const struct ps_prochandle *, +extern ps_err_e ps_get_thread_area (struct ps_prochandle *, lwpid_t, int, psaddr_t *); @@ -78,9 +83,13 @@ extern ps_err_e ps_pglobal_lookup (struct ps_prochandle *, /* Stop or continue the entire process. */ -extern ps_err_e ps_pstop (const struct ps_prochandle *); -extern ps_err_e ps_pcontinue (const struct ps_prochandle *); +extern ps_err_e ps_pstop (struct ps_prochandle *); +extern ps_err_e ps_pcontinue (struct ps_prochandle *); /* Stop or continue the given LWP alone. */ -extern ps_err_e ps_lstop (const struct ps_prochandle *, lwpid_t); -extern ps_err_e ps_lcontinue (const struct ps_prochandle *, lwpid_t); +extern ps_err_e ps_lstop (struct ps_prochandle *, lwpid_t); +extern ps_err_e ps_lcontinue (struct ps_prochandle *, lwpid_t); + +__END_DECLS + +#endif /* proc_service.h */ diff --git a/nptl_db/structs.def b/nptl_db/structs.def index a9b621b126..15ec77f4ab 100644 --- a/nptl_db/structs.def +++ b/nptl_db/structs.def @@ -1,5 +1,5 @@ /* List of types and symbols in libpthread examined by libthread_db. - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -48,7 +48,6 @@ DB_STRUCT (pthread) DB_STRUCT_FIELD (pthread, list) DB_STRUCT_FIELD (pthread, report_events) DB_STRUCT_FIELD (pthread, tid) -DB_STRUCT_FIELD (pthread, pid) DB_STRUCT_FIELD (pthread, start_routine) DB_STRUCT_FIELD (pthread, cancelhandling) DB_STRUCT_FIELD (pthread, schedpolicy) diff --git a/nptl_db/td_init.c b/nptl_db/td_init.c index 58743b34d9..93f3b30d6d 100644 --- a/nptl_db/td_init.c +++ b/nptl_db/td_init.c @@ -1,5 +1,5 @@ /* Initialization function of thread debugger support library. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_log.c b/nptl_db/td_log.c index 160a1f2ee8..e5e85f264e 100644 --- a/nptl_db/td_log.c +++ b/nptl_db/td_log.c @@ -1,5 +1,5 @@ /* Noop, left for historical reasons. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_symbol_list.c b/nptl_db/td_symbol_list.c index 73c4fe8224..da316ed176 100644 --- a/nptl_db/td_symbol_list.c +++ b/nptl_db/td_symbol_list.c @@ -1,5 +1,5 @@ /* Return list of symbols the library can request. - Copyright (C) 2001-2016 Free Software Foundation, Inc. + Copyright (C) 2001-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2001. diff --git a/nptl_db/td_ta_clear_event.c b/nptl_db/td_ta_clear_event.c index 01d221349c..cb44c9cae5 100644 --- a/nptl_db/td_ta_clear_event.c +++ b/nptl_db/td_ta_clear_event.c @@ -1,5 +1,5 @@ /* Globally disable events. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_delete.c b/nptl_db/td_ta_delete.c index 71ffcbc143..516d2d945a 100644 --- a/nptl_db/td_ta_delete.c +++ b/nptl_db/td_ta_delete.c @@ -1,5 +1,5 @@ /* Detach to target process. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_enable_stats.c b/nptl_db/td_ta_enable_stats.c index faa66fe7c6..689b4c68b5 100644 --- a/nptl_db/td_ta_enable_stats.c +++ b/nptl_db/td_ta_enable_stats.c @@ -1,5 +1,5 @@ /* Enable collection of statistics for process. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_event_addr.c b/nptl_db/td_ta_event_addr.c index fb75a9049b..2550e2292f 100644 --- a/nptl_db/td_ta_event_addr.c +++ b/nptl_db/td_ta_event_addr.c @@ -1,5 +1,5 @@ /* Get event address. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_event_getmsg.c b/nptl_db/td_ta_event_getmsg.c index c4e8e38bcc..64d4cbd7e2 100644 --- a/nptl_db/td_ta_event_getmsg.c +++ b/nptl_db/td_ta_event_getmsg.c @@ -1,5 +1,5 @@ /* Retrieve event. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_get_nthreads.c b/nptl_db/td_ta_get_nthreads.c index 777a707c51..a1acf2c483 100644 --- a/nptl_db/td_ta_get_nthreads.c +++ b/nptl_db/td_ta_get_nthreads.c @@ -1,5 +1,5 @@ /* Get the number of threads in the process. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_get_ph.c b/nptl_db/td_ta_get_ph.c index 6f9f26a5b3..58dec0ea5b 100644 --- a/nptl_db/td_ta_get_ph.c +++ b/nptl_db/td_ta_get_ph.c @@ -1,5 +1,5 @@ /* Get external process handle. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_get_stats.c b/nptl_db/td_ta_get_stats.c index d922394bc7..aef182919a 100644 --- a/nptl_db/td_ta_get_stats.c +++ b/nptl_db/td_ta_get_stats.c @@ -1,5 +1,5 @@ /* Retrieve statistics for process. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_map_id2thr.c b/nptl_db/td_ta_map_id2thr.c index 65a21cab10..74ba34affe 100644 --- a/nptl_db/td_ta_map_id2thr.c +++ b/nptl_db/td_ta_map_id2thr.c @@ -1,5 +1,5 @@ /* Map thread ID to thread handle. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_map_lwp2thr.c b/nptl_db/td_ta_map_lwp2thr.c index 94fd2b9b0e..9ccfde82fe 100644 --- a/nptl_db/td_ta_map_lwp2thr.c +++ b/nptl_db/td_ta_map_lwp2thr.c @@ -1,5 +1,5 @@ /* Which thread is running on an LWP? - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl_db/td_ta_new.c b/nptl_db/td_ta_new.c index 5508dfe914..99c3d2c7b1 100644 --- a/nptl_db/td_ta_new.c +++ b/nptl_db/td_ta_new.c @@ -1,5 +1,5 @@ /* Attach to target process. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_reset_stats.c b/nptl_db/td_ta_reset_stats.c index e32ad65028..fb221d7252 100644 --- a/nptl_db/td_ta_reset_stats.c +++ b/nptl_db/td_ta_reset_stats.c @@ -1,5 +1,5 @@ /* Reset statistics. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_set_event.c b/nptl_db/td_ta_set_event.c index 6a465bdf8c..1cdb744a2a 100644 --- a/nptl_db/td_ta_set_event.c +++ b/nptl_db/td_ta_set_event.c @@ -1,5 +1,5 @@ /* Globally enable events. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_setconcurrency.c b/nptl_db/td_ta_setconcurrency.c index 48a9bbe96c..3645e71508 100644 --- a/nptl_db/td_ta_setconcurrency.c +++ b/nptl_db/td_ta_setconcurrency.c @@ -1,5 +1,5 @@ /* Set suggested concurrency level for process. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_ta_thr_iter.c b/nptl_db/td_ta_thr_iter.c index a990fed150..00d6c9a416 100644 --- a/nptl_db/td_ta_thr_iter.c +++ b/nptl_db/td_ta_thr_iter.c @@ -1,5 +1,5 @@ /* Iterate over a process's threads. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -23,7 +23,7 @@ static td_err_e iterate_thread_list (td_thragent_t *ta, td_thr_iter_f *callback, void *cbdata_p, td_thr_state_e state, int ti_pri, - psaddr_t head, bool fake_empty, pid_t match_pid) + psaddr_t head, bool fake_empty) { td_err_e err; psaddr_t next, ofs; @@ -76,48 +76,28 @@ iterate_thread_list (td_thragent_t *ta, td_thr_iter_f *callback, if (ps_pdread (ta->ph, addr, copy, ta->ta_sizeof_pthread) != PS_OK) return TD_ERR; - /* Verify that this thread's pid field matches the child PID. - If its pid field is negative, it's about to do a fork or it - is the sole thread in a fork child. */ - psaddr_t pid; - err = DB_GET_FIELD_LOCAL (pid, ta, copy, pthread, pid, 0); - if (err == TD_OK && (pid_t) (uintptr_t) pid < 0) - { - if (-(pid_t) (uintptr_t) pid == match_pid) - /* It is about to do a fork, but is really still the parent PID. */ - pid = (psaddr_t) (uintptr_t) match_pid; - else - /* It must be a fork child, whose new PID is in the tid field. */ - err = DB_GET_FIELD_LOCAL (pid, ta, copy, pthread, tid, 0); - } + err = DB_GET_FIELD_LOCAL (schedpolicy, ta, copy, pthread, + schedpolicy, 0); if (err != TD_OK) break; + err = DB_GET_FIELD_LOCAL (schedprio, ta, copy, pthread, + schedparam_sched_priority, 0); + if (err != TD_OK) + break; + + /* Now test whether this thread matches the specified conditions. */ - if ((pid_t) (uintptr_t) pid == match_pid) + /* Only if the priority level is as high or higher. */ + int descr_pri = ((uintptr_t) schedpolicy == SCHED_OTHER + ? 0 : (uintptr_t) schedprio); + if (descr_pri >= ti_pri) { - err = DB_GET_FIELD_LOCAL (schedpolicy, ta, copy, pthread, - schedpolicy, 0); - if (err != TD_OK) - break; - err = DB_GET_FIELD_LOCAL (schedprio, ta, copy, pthread, - schedparam_sched_priority, 0); - if (err != TD_OK) - break; - - /* Now test whether this thread matches the specified conditions. */ - - /* Only if the priority level is as high or higher. */ - int descr_pri = ((uintptr_t) schedpolicy == SCHED_OTHER - ? 0 : (uintptr_t) schedprio); - if (descr_pri >= ti_pri) - { - /* Yep, it matches. Call the callback function. */ - td_thrhandle_t th; - th.th_ta_p = (td_thragent_t *) ta; - th.th_unique = addr; - if (callback (&th, cbdata_p) != 0) - return TD_DBERR; - } + /* Yep, it matches. Call the callback function. */ + td_thrhandle_t th; + th.th_ta_p = (td_thragent_t *) ta; + th.th_unique = addr; + if (callback (&th, cbdata_p) != 0) + return TD_DBERR; } /* Get the pointer to the next element. */ @@ -153,18 +133,17 @@ td_ta_thr_iter (const td_thragent_t *ta_arg, td_thr_iter_f *callback, have to iterate over both lists separately. We start with the list of threads with user-defined stacks. */ - pid_t pid = ps_getpid (ta->ph); err = DB_GET_SYMBOL (list, ta, __stack_user); if (err == TD_OK) err = iterate_thread_list (ta, callback, cbdata_p, state, ti_pri, - list, true, pid); + list, true); /* And the threads with stacks allocated by the implementation. */ if (err == TD_OK) err = DB_GET_SYMBOL (list, ta, stack_used); if (err == TD_OK) err = iterate_thread_list (ta, callback, cbdata_p, state, ti_pri, - list, false, pid); + list, false); return err; } diff --git a/nptl_db/td_ta_tsd_iter.c b/nptl_db/td_ta_tsd_iter.c index 84db2735b3..561514e0f3 100644 --- a/nptl_db/td_ta_tsd_iter.c +++ b/nptl_db/td_ta_tsd_iter.c @@ -1,5 +1,5 @@ /* Iterate over a process's thread-specific data. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_clear_event.c b/nptl_db/td_thr_clear_event.c index ae132af673..36687f4f89 100644 --- a/nptl_db/td_thr_clear_event.c +++ b/nptl_db/td_thr_clear_event.c @@ -1,5 +1,5 @@ /* Disable specific event for thread. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_dbresume.c b/nptl_db/td_thr_dbresume.c index 433cbffe3a..10e6348832 100644 --- a/nptl_db/td_thr_dbresume.c +++ b/nptl_db/td_thr_dbresume.c @@ -1,5 +1,5 @@ /* Resume execution of given thread. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_dbsuspend.c b/nptl_db/td_thr_dbsuspend.c index 0d9ad6971d..58a4960d0a 100644 --- a/nptl_db/td_thr_dbsuspend.c +++ b/nptl_db/td_thr_dbsuspend.c @@ -1,5 +1,5 @@ /* Suspend execution of given thread. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_event_enable.c b/nptl_db/td_thr_event_enable.c index e18b215fb7..6b909b68d6 100644 --- a/nptl_db/td_thr_event_enable.c +++ b/nptl_db/td_thr_event_enable.c @@ -1,5 +1,5 @@ /* Enable event process-wide. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_event_getmsg.c b/nptl_db/td_thr_event_getmsg.c index 7e225e1173..6814418d5f 100644 --- a/nptl_db/td_thr_event_getmsg.c +++ b/nptl_db/td_thr_event_getmsg.c @@ -1,5 +1,5 @@ /* Retrieve event. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_get_info.c b/nptl_db/td_thr_get_info.c index 539aa9bbd6..ce378738c0 100644 --- a/nptl_db/td_thr_get_info.c +++ b/nptl_db/td_thr_get_info.c @@ -1,5 +1,5 @@ /* Get thread information. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_getfpregs.c b/nptl_db/td_thr_getfpregs.c index 5a067314fb..fd02cdebeb 100644 --- a/nptl_db/td_thr_getfpregs.c +++ b/nptl_db/td_thr_getfpregs.c @@ -1,5 +1,5 @@ /* Get a thread's floating-point register set. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_getgregs.c b/nptl_db/td_thr_getgregs.c index 205e48c29e..fd72f010c3 100644 --- a/nptl_db/td_thr_getgregs.c +++ b/nptl_db/td_thr_getgregs.c @@ -1,5 +1,5 @@ /* Get a thread's general register set. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_getxregs.c b/nptl_db/td_thr_getxregs.c index 4354e2e772..41c1273750 100644 --- a/nptl_db/td_thr_getxregs.c +++ b/nptl_db/td_thr_getxregs.c @@ -1,5 +1,5 @@ /* Get a thread's extra state register set. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_getxregsize.c b/nptl_db/td_thr_getxregsize.c index e22ed1f8dd..a610556ee3 100644 --- a/nptl_db/td_thr_getxregsize.c +++ b/nptl_db/td_thr_getxregsize.c @@ -1,5 +1,5 @@ /* Get the size of the extra state register set for this architecture. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_set_event.c b/nptl_db/td_thr_set_event.c index 4607f452dc..06a7a92a44 100644 --- a/nptl_db/td_thr_set_event.c +++ b/nptl_db/td_thr_set_event.c @@ -1,5 +1,5 @@ /* Enable specific event for thread. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_setfpregs.c b/nptl_db/td_thr_setfpregs.c index 16569a220f..8484017927 100644 --- a/nptl_db/td_thr_setfpregs.c +++ b/nptl_db/td_thr_setfpregs.c @@ -1,5 +1,5 @@ /* Set a thread's floating-point register set. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_setgregs.c b/nptl_db/td_thr_setgregs.c index 6f0471eca4..a0d6498259 100644 --- a/nptl_db/td_thr_setgregs.c +++ b/nptl_db/td_thr_setgregs.c @@ -1,5 +1,5 @@ /* Set a thread's general register set. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_setprio.c b/nptl_db/td_thr_setprio.c index cf5856453c..e3db900bb1 100644 --- a/nptl_db/td_thr_setprio.c +++ b/nptl_db/td_thr_setprio.c @@ -1,5 +1,5 @@ /* Set a thread's priority. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_setsigpending.c b/nptl_db/td_thr_setsigpending.c index f1903bca5a..a28125efff 100644 --- a/nptl_db/td_thr_setsigpending.c +++ b/nptl_db/td_thr_setsigpending.c @@ -1,5 +1,5 @@ /* Raise a signal for a thread. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_setxregs.c b/nptl_db/td_thr_setxregs.c index e0158b716a..5d7a853c7d 100644 --- a/nptl_db/td_thr_setxregs.c +++ b/nptl_db/td_thr_setxregs.c @@ -1,5 +1,5 @@ /* Set a thread's extra state register set. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_sigsetmask.c b/nptl_db/td_thr_sigsetmask.c index 1d3a9d9463..97d51977a4 100644 --- a/nptl_db/td_thr_sigsetmask.c +++ b/nptl_db/td_thr_sigsetmask.c @@ -1,5 +1,5 @@ /* Set a thread's signal mask. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_tls_get_addr.c b/nptl_db/td_thr_tls_get_addr.c index bc7dea1897..8676470ee2 100644 --- a/nptl_db/td_thr_tls_get_addr.c +++ b/nptl_db/td_thr_tls_get_addr.c @@ -1,5 +1,5 @@ /* Get address of thread local variable. - Copyright (C) 2002-2016 Free Software Foundation, Inc. + Copyright (C) 2002-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 2002. diff --git a/nptl_db/td_thr_tlsbase.c b/nptl_db/td_thr_tlsbase.c index aa202c2580..a693a868bb 100644 --- a/nptl_db/td_thr_tlsbase.c +++ b/nptl_db/td_thr_tlsbase.c @@ -1,5 +1,5 @@ /* Locate TLS data for a thread. - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/nptl_db/td_thr_tsd.c b/nptl_db/td_thr_tsd.c index 90cf6d7547..bc9f7626fd 100644 --- a/nptl_db/td_thr_tsd.c +++ b/nptl_db/td_thr_tsd.c @@ -1,5 +1,5 @@ /* Get a thread-specific data pointer for a thread. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. diff --git a/nptl_db/td_thr_validate.c b/nptl_db/td_thr_validate.c index f3c8a7bed6..d677a63727 100644 --- a/nptl_db/td_thr_validate.c +++ b/nptl_db/td_thr_validate.c @@ -1,5 +1,5 @@ /* Validate a thread handle. - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -80,28 +80,5 @@ td_thr_validate (const td_thrhandle_t *th) err = TD_OK; } - if (err == TD_OK) - { - /* Verify that this is not a stale element in a fork child. */ - pid_t match_pid = ps_getpid (th->th_ta_p->ph); - psaddr_t pid; - err = DB_GET_FIELD (pid, th->th_ta_p, th->th_unique, pthread, pid, 0); - if (err == TD_OK && (pid_t) (uintptr_t) pid < 0) - { - /* This was a thread that was about to fork, or it is the new sole - thread in a fork child. In the latter case, its tid was stored - via CLONE_CHILD_SETTID and so is already the proper child PID. */ - if (-(pid_t) (uintptr_t) pid == match_pid) - /* It is about to do a fork, but is really still the parent PID. */ - pid = (psaddr_t) (uintptr_t) match_pid; - else - /* It must be a fork child, whose new PID is in the tid field. */ - err = DB_GET_FIELD (pid, th->th_ta_p, th->th_unique, - pthread, tid, 0); - } - if (err == TD_OK && (pid_t) (uintptr_t) pid != match_pid) - err = TD_NOTHR; - } - return err; } diff --git a/nptl_db/thread_db.h b/nptl_db/thread_db.h index abb95df3fb..4206aed02f 100644 --- a/nptl_db/thread_db.h +++ b/nptl_db/thread_db.h @@ -1,5 +1,5 @@ /* thread_db.h -- interface to libthread_db.so library for debugging -lpthread - Copyright (C) 1999-2016 Free Software Foundation, Inc. + Copyright (C) 1999-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -108,7 +108,7 @@ struct link_map; #define TD_EVENTSIZE 2 #define BT_UISHIFT 5 /* log base 2 of BT_NBIPUI, to extract word index */ -#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per uint */ +#define BT_NBIPUI (1 << BT_UISHIFT) /* n bits per unsigned int */ #define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index */ /* Bitmask of enabled events. */ diff --git a/nptl_db/thread_dbP.h b/nptl_db/thread_dbP.h index 39c3061786..bcb2764074 100644 --- a/nptl_db/thread_dbP.h +++ b/nptl_db/thread_dbP.h @@ -1,5 +1,5 @@ /* Private header for thread debug library - Copyright (C) 2003-2016 Free Software Foundation, Inc. + Copyright (C) 2003-2018 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -30,6 +30,7 @@ #include "../nptl/pthreadP.h" /* This is for *_BITMASK only. */ #include <list.h> #include <gnu/lib-names.h> +#include <libc-diag.h> /* Indeces for the symbol names. */ enum @@ -160,10 +161,19 @@ extern ps_err_e td_mod_lookup (struct ps_prochandle *ps, const char *modname, SYM_##type##_FIELD_##field, \ (psaddr_t) 0 + (idx), (ptr), &(var)) +/* With GCC 5.3 when compiling with -Os the compiler emits a warning + that slot may be used uninitialized. This is never the case since + the dynamic loader initializes the slotinfo list and + dtv_slotinfo_list will point slot at the first entry. Therefore + when DB_GET_FIELD_ADDRESS is called with a slot for ptr, the slot is + always initialized. */ +DIAG_PUSH_NEEDS_COMMENT; +DIAG_IGNORE_Os_NEEDS_COMMENT (5, "-Wmaybe-uninitialized"); #define DB_GET_FIELD_ADDRESS(var, ta, ptr, type, field, idx) \ ((var) = (ptr), _td_locate_field ((ta), (ta)->ta_field_##type##_##field, \ SYM_##type##_FIELD_##field, \ (psaddr_t) 0 + (idx), &(var))) +DIAG_POP_NEEDS_COMMENT; extern td_err_e _td_locate_field (td_thragent_t *ta, db_desc_t desc, int descriptor_name, |