diff options
Diffstat (limited to 'nptl_db')
48 files changed, 106 insertions, 646 deletions
diff --git a/nptl_db/Makefile b/nptl_db/Makefile index 046840ec3f..bbe38ca273 100644 --- a/nptl_db/Makefile +++ b/nptl_db/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2019 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 @@ -13,7 +13,7 @@ # You should have received a copy of the GNU Lesser General Public # License along with the GNU C Library; if not, see -# <http://www.gnu.org/licenses/>. +# <https://www.gnu.org/licenses/>. # Makefile for NPTL debug library subdirectory of GNU C Library. diff --git a/nptl_db/db-symbols.h b/nptl_db/db-symbols.h index e2f7cf6306..7c53d803bf 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-2018 Free Software Foundation, Inc. + Copyright (C) 2009-2019 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 @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #define DOT(x) x /* No prefix. */ @@ -25,6 +25,7 @@ DB_LOOKUP_NAME (SYM_SIZEOF_##type, _thread_db_sizeof_##type) #define DB_STRUCT_FIELD(type, field) \ DB_LOOKUP_NAME (SYM_##type##_FIELD_##field, _thread_db_##type##_##field) +#define DB_STRUCT_FLEXIBLE_ARRAY(type, field) DB_STRUCT_FIELD (type, field) #define DB_SYMBOL(name) \ DB_LOOKUP_NAME (SYM_##name, name) #define DB_FUNCTION(name) \ @@ -36,6 +37,8 @@ # include "structs.def" # undef DB_STRUCT +# undef DB_STRUCT_FIELD +# undef DB_STRUCT_FLEXIBLE_ARRAY # undef DB_FUNCTION # undef DB_SYMBOL # undef DB_VARIABLE diff --git a/nptl_db/db_info.c b/nptl_db/db_info.c index 7f23cf4620..40efe1a29b 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-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 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,7 +16,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stdint.h> #include "thread_dbP.h" @@ -56,6 +56,9 @@ extern bool __nptl_initial_report_events; DB_DEFINE_DESC (name, \ 8 * sizeof (obj)[0], sizeof (obj) / sizeof (obj)[0], \ offset); +/* Flexible arrays do not have a length that can be determined. */ +#define FLEXIBLE_ARRAY_DESC(name, offset, obj) \ + DB_DEFINE_DESC (name, 8 * sizeof (obj)[0], 0, offset); #if TLS_TCB_AT_TP # define dtvp header.dtv @@ -77,6 +80,9 @@ DESC (_thread_db_pthread_dtvp, #define DB_STRUCT_ARRAY_FIELD(type, field) \ ARRAY_DESC (_thread_db_##type##_##field, \ offsetof (type, field), ((type *) 0)->field) +#define DB_STRUCT_FLEXIBLE_ARRAY(type, field) \ + FLEXIBLE_ARRAY_DESC (_thread_db_##type##_##field, \ + offsetof (type, field), ((type *) 0)->field) #define DB_VARIABLE(name) DESC (_thread_db_##name, 0, name) #define DB_ARRAY_VARIABLE(name) ARRAY_DESC (_thread_db_##name, 0, name) #define DB_SYMBOL(name) /* Nothing. */ diff --git a/nptl_db/fetch-value.c b/nptl_db/fetch-value.c index 8514898e2b..ce620c58ae 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-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 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 @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" #include <byteswap.h> diff --git a/nptl_db/proc_service.h b/nptl_db/proc_service.h deleted file mode 100644 index 1b88982f00..0000000000 --- a/nptl_db/proc_service.h +++ /dev/null @@ -1,95 +0,0 @@ -/* Callback interface for libthread_db, functions users must define. - 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - 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 -{ - PS_OK, /* Generic "call succeeded". */ - PS_ERR, /* Generic error. */ - PS_BADPID, /* Bad process handle. */ - PS_BADLID, /* Bad LWP identifier. */ - PS_BADADDR, /* Bad address. */ - PS_NOSYM, /* Could not find given symbol. */ - PS_NOFREGS /* FPU register set not available for given LWP. */ -} ps_err_e; - - -/* This type is opaque in this interface. - It's defined by the user of libthread_db. */ -struct ps_prochandle; - - -/* Read or write process memory at the given address. */ -extern ps_err_e ps_pdread (struct ps_prochandle *, - psaddr_t, void *, size_t); -extern ps_err_e ps_pdwrite (struct ps_prochandle *, - psaddr_t, const void *, size_t); -extern ps_err_e ps_ptread (struct ps_prochandle *, - psaddr_t, void *, size_t); -extern ps_err_e ps_ptwrite (struct ps_prochandle *, - psaddr_t, const void *, size_t); - - -/* Get and set the given LWP's general or FPU register set. */ -extern ps_err_e ps_lgetregs (struct ps_prochandle *, - lwpid_t, prgregset_t); -extern ps_err_e ps_lsetregs (struct ps_prochandle *, - lwpid_t, const prgregset_t); -extern ps_err_e ps_lgetfpregs (struct ps_prochandle *, - lwpid_t, prfpregset_t *); -extern ps_err_e ps_lsetfpregs (struct ps_prochandle *, - lwpid_t, const prfpregset_t *); - -/* Return the PID of the process. */ -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 (struct ps_prochandle *, - lwpid_t, int, psaddr_t *); - - -/* Look up the named symbol in the named DSO in the symbol tables - associated with the process being debugged, filling in *SYM_ADDR - with the corresponding run-time address. */ -extern ps_err_e ps_pglobal_lookup (struct ps_prochandle *, - const char *object_name, - const char *sym_name, - psaddr_t *sym_addr); - - -/* Stop or continue the entire process. */ -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 (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 15ec77f4ab..a3aa71aade 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-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 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 @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef DB_STRUCT_ARRAY_FIELD # define DB_STRUCT_ARRAY_FIELD(type, field) DB_STRUCT_FIELD (type, field) @@ -110,7 +110,7 @@ DB_RTLD_GLOBAL_FIELD (dl_tls_dtv_slotinfo_list) DB_STRUCT (dtv_slotinfo_list) DB_STRUCT_FIELD (dtv_slotinfo_list, len) DB_STRUCT_FIELD (dtv_slotinfo_list, next) -DB_STRUCT_ARRAY_FIELD (dtv_slotinfo_list, slotinfo) +DB_STRUCT_FLEXIBLE_ARRAY (dtv_slotinfo_list, slotinfo) DB_STRUCT (dtv_slotinfo) DB_STRUCT_FIELD (dtv_slotinfo, gen) diff --git a/nptl_db/td_init.c b/nptl_db/td_init.c index 93f3b30d6d..28100b581e 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_log.c b/nptl_db/td_log.c index e5e85f264e..a41b885398 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_symbol_list.c b/nptl_db/td_symbol_list.c index da316ed176..fd9bbc487d 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-2018 Free Software Foundation, Inc. + Copyright (C) 2001-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2001. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <assert.h> #include "thread_dbP.h" diff --git a/nptl_db/td_ta_clear_event.c b/nptl_db/td_ta_clear_event.c index cb44c9cae5..28b248d813 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stdint.h> #include "thread_dbP.h" diff --git a/nptl_db/td_ta_delete.c b/nptl_db/td_ta_delete.c index 516d2d945a..53d675048b 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stdlib.h> diff --git a/nptl_db/td_ta_enable_stats.c b/nptl_db/td_ta_enable_stats.c index 689b4c68b5..610861bdba 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_event_addr.c b/nptl_db/td_ta_event_addr.c index 2550e2292f..33d061c69a 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_event_getmsg.c b/nptl_db/td_ta_event_getmsg.c index 64d4cbd7e2..5fb5ba68b7 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stddef.h> #include <string.h> diff --git a/nptl_db/td_ta_get_nthreads.c b/nptl_db/td_ta_get_nthreads.c index a1acf2c483..3827cb2f76 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_get_ph.c b/nptl_db/td_ta_get_ph.c index 58dec0ea5b..202cb8ee9a 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_get_stats.c b/nptl_db/td_ta_get_stats.c index aef182919a..5dc77b9b07 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_map_id2thr.c b/nptl_db/td_ta_map_id2thr.c index 74ba34affe..a5be66ffe9 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_map_lwp2thr.c b/nptl_db/td_ta_map_lwp2thr.c index 9ccfde82fe..f5b953c932 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-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 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 @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" #include <stdlib.h> diff --git a/nptl_db/td_ta_new.c b/nptl_db/td_ta_new.c index 99c3d2c7b1..63ffe4ca2f 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stddef.h> #include <stdlib.h> diff --git a/nptl_db/td_ta_reset_stats.c b/nptl_db/td_ta_reset_stats.c index fb221d7252..27a8d41801 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_set_event.c b/nptl_db/td_ta_set_event.c index 1cdb744a2a..fe02f26757 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stdint.h> #include "thread_dbP.h" diff --git a/nptl_db/td_ta_setconcurrency.c b/nptl_db/td_ta_setconcurrency.c index 3645e71508..376f32a123 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_thr_iter.c b/nptl_db/td_ta_thr_iter.c index 00d6c9a416..43b7ffbc22 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_ta_tsd_iter.c b/nptl_db/td_ta_tsd_iter.c index 561514e0f3..af2c1c9077 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stdint.h> #include "thread_dbP.h" diff --git a/nptl_db/td_thr_clear_event.c b/nptl_db/td_thr_clear_event.c index 36687f4f89..b550e1ed80 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stddef.h> #include <stdint.h> diff --git a/nptl_db/td_thr_dbresume.c b/nptl_db/td_thr_dbresume.c index 10e6348832..995896d40a 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_dbsuspend.c b/nptl_db/td_thr_dbsuspend.c index 58a4960d0a..caf3d76eab 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_event_enable.c b/nptl_db/td_thr_event_enable.c index 6b909b68d6..2f6f2e78e3 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_event_getmsg.c b/nptl_db/td_thr_event_getmsg.c index 6814418d5f..e793e1ada0 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" #include <assert.h> diff --git a/nptl_db/td_thr_get_info.c b/nptl_db/td_thr_get_info.c index ce378738c0..b6c958fd22 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stddef.h> #include <string.h> diff --git a/nptl_db/td_thr_getfpregs.c b/nptl_db/td_thr_getfpregs.c index fd02cdebeb..1a915dad9c 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_getgregs.c b/nptl_db/td_thr_getgregs.c index fd72f010c3..b693e13458 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_getxregs.c b/nptl_db/td_thr_getxregs.c index 41c1273750..bf7e29a892 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_getxregsize.c b/nptl_db/td_thr_getxregsize.c index a610556ee3..94f0c3c28d 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_set_event.c b/nptl_db/td_thr_set_event.c index 06a7a92a44..85192e07be 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stddef.h> #include <stdint.h> diff --git a/nptl_db/td_thr_setfpregs.c b/nptl_db/td_thr_setfpregs.c index 8484017927..4c49d1744c 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_setgregs.c b/nptl_db/td_thr_setgregs.c index a0d6498259..5cdc09a25a 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_setprio.c b/nptl_db/td_thr_setprio.c index e3db900bb1..1f3669cea8 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_setsigpending.c b/nptl_db/td_thr_setsigpending.c index a28125efff..7ee8b5a199 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_setxregs.c b/nptl_db/td_thr_setxregs.c index 5d7a853c7d..d02c6bb7c7 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_sigsetmask.c b/nptl_db/td_thr_sigsetmask.c index 97d51977a4..48c68d88d8 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" diff --git a/nptl_db/td_thr_tls_get_addr.c b/nptl_db/td_thr_tls_get_addr.c index 8676470ee2..e77d9731e1 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-2018 Free Software Foundation, Inc. + Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 2002. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <link.h> #include "thread_dbP.h" diff --git a/nptl_db/td_thr_tlsbase.c b/nptl_db/td_thr_tlsbase.c index a693a868bb..5fe4484654 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-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 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 @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" #include <link.h> diff --git a/nptl_db/td_thr_tsd.c b/nptl_db/td_thr_tsd.c index bc9f7626fd..5c2f5da75a 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include <stdint.h> #include "thread_dbP.h" diff --git a/nptl_db/td_thr_validate.c b/nptl_db/td_thr_validate.c index d677a63727..04da2fdba0 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-2018 Free Software Foundation, Inc. + Copyright (C) 1999-2019 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999. @@ -15,7 +15,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #include "thread_dbP.h" #include <stdbool.h> diff --git a/nptl_db/thread_db.h b/nptl_db/thread_db.h deleted file mode 100644 index 4206aed02f..0000000000 --- a/nptl_db/thread_db.h +++ /dev/null @@ -1,458 +0,0 @@ -/* thread_db.h -- interface to libthread_db.so library for debugging -lpthread - 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 - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#ifndef _THREAD_DB_H -#define _THREAD_DB_H 1 - -/* This is the debugger interface for the NPTL library. It is - modelled closely after the interface with same names in Solaris - with the goal to share the same code in the debugger. */ -#include <pthread.h> -#include <stdint.h> -#include <sys/types.h> -#include <sys/procfs.h> - - -/* Error codes of the library. */ -typedef enum -{ - TD_OK, /* No error. */ - TD_ERR, /* No further specified error. */ - TD_NOTHR, /* No matching thread found. */ - TD_NOSV, /* No matching synchronization handle found. */ - TD_NOLWP, /* No matching light-weighted process found. */ - TD_BADPH, /* Invalid process handle. */ - TD_BADTH, /* Invalid thread handle. */ - TD_BADSH, /* Invalid synchronization handle. */ - TD_BADTA, /* Invalid thread agent. */ - TD_BADKEY, /* Invalid key. */ - TD_NOMSG, /* No event available. */ - TD_NOFPREGS, /* No floating-point register content available. */ - TD_NOLIBTHREAD, /* Application not linked with thread library. */ - TD_NOEVENT, /* Requested event is not supported. */ - TD_NOCAPAB, /* Capability not available. */ - TD_DBERR, /* Internal debug library error. */ - TD_NOAPLIC, /* Operation is not applicable. */ - TD_NOTSD, /* No thread-specific data available. */ - TD_MALLOC, /* Out of memory. */ - TD_PARTIALREG, /* Not entire register set was read or written. */ - TD_NOXREGS, /* X register set not available for given thread. */ - TD_TLSDEFER, /* Thread has not yet allocated TLS for given module. */ - TD_NOTALLOC = TD_TLSDEFER, - TD_VERSION, /* Version if libpthread and libthread_db do not match. */ - TD_NOTLS /* There is no TLS segment in the given module. */ -} td_err_e; - - -/* Possible thread states. TD_THR_ANY_STATE is a pseudo-state used to - select threads regardless of state in td_ta_thr_iter(). */ -typedef enum -{ - TD_THR_ANY_STATE, - TD_THR_UNKNOWN, - TD_THR_STOPPED, - TD_THR_RUN, - TD_THR_ACTIVE, - TD_THR_ZOMBIE, - TD_THR_SLEEP, - TD_THR_STOPPED_ASLEEP -} td_thr_state_e; - -/* Thread type: user or system. TD_THR_ANY_TYPE is a pseudo-type used - to select threads regardless of type in td_ta_thr_iter(). */ -typedef enum -{ - TD_THR_ANY_TYPE, - TD_THR_USER, - TD_THR_SYSTEM -} td_thr_type_e; - - -/* Types of the debugging library. */ - -/* Handle for a process. This type is opaque. */ -typedef struct td_thragent td_thragent_t; - -/* The actual thread handle type. This is also opaque. */ -typedef struct td_thrhandle -{ - td_thragent_t *th_ta_p; - psaddr_t th_unique; -} td_thrhandle_t; - - -/* Forward declaration of a type defined by and for the dynamic linker. */ -struct link_map; - - -/* Flags for `td_ta_thr_iter'. */ -#define TD_THR_ANY_USER_FLAGS 0xffffffff -#define TD_THR_LOWEST_PRIORITY -20 -#define TD_SIGNO_MASK NULL - - -#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 unsigned int */ -#define BT_UIMASK (BT_NBIPUI - 1) /* to extract bit index */ - -/* Bitmask of enabled events. */ -typedef struct td_thr_events -{ - uint32_t event_bits[TD_EVENTSIZE]; -} td_thr_events_t; - -/* Event set manipulation macros. */ -#define __td_eventmask(n) \ - (UINT32_C (1) << (((n) - 1) & BT_UIMASK)) -#define __td_eventword(n) \ - ((UINT32_C ((n) - 1)) >> BT_UISHIFT) - -#define td_event_emptyset(setp) \ - do { \ - int __i; \ - for (__i = TD_EVENTSIZE; __i > 0; --__i) \ - (setp)->event_bits[__i - 1] = 0; \ - } while (0) - -#define td_event_fillset(setp) \ - do { \ - int __i; \ - for (__i = TD_EVENTSIZE; __i > 0; --__i) \ - (setp)->event_bits[__i - 1] = UINT32_C (0xffffffff); \ - } while (0) - -#define td_event_addset(setp, n) \ - (((setp)->event_bits[__td_eventword (n)]) |= __td_eventmask (n)) -#define td_event_delset(setp, n) \ - (((setp)->event_bits[__td_eventword (n)]) &= ~__td_eventmask (n)) -#define td_eventismember(setp, n) \ - (__td_eventmask (n) & ((setp)->event_bits[__td_eventword (n)])) -#if TD_EVENTSIZE == 2 -# define td_eventisempty(setp) \ - (!((setp)->event_bits[0]) && !((setp)->event_bits[1])) -#else -# error "td_eventisempty must be changed to match TD_EVENTSIZE" -#endif - -/* Events reportable by the thread implementation. */ -typedef enum -{ - TD_ALL_EVENTS, /* Pseudo-event number. */ - TD_EVENT_NONE = TD_ALL_EVENTS, /* Depends on context. */ - TD_READY, /* Is executable now. */ - TD_SLEEP, /* Blocked in a synchronization obj. */ - TD_SWITCHTO, /* Now assigned to a process. */ - TD_SWITCHFROM, /* Not anymore assigned to a process. */ - TD_LOCK_TRY, /* Trying to get an unavailable lock. */ - TD_CATCHSIG, /* Signal posted to the thread. */ - TD_IDLE, /* Process getting idle. */ - TD_CREATE, /* New thread created. */ - TD_DEATH, /* Thread terminated. */ - TD_PREEMPT, /* Preempted. */ - TD_PRI_INHERIT, /* Inherited elevated priority. */ - TD_REAP, /* Reaped. */ - TD_CONCURRENCY, /* Number of processes changing. */ - TD_TIMEOUT, /* Conditional variable wait timed out. */ - TD_MIN_EVENT_NUM = TD_READY, - TD_MAX_EVENT_NUM = TD_TIMEOUT, - TD_EVENTS_ENABLE = 31 /* Event reporting enabled. */ -} td_event_e; - -/* Values representing the different ways events are reported. */ -typedef enum -{ - NOTIFY_BPT, /* User must insert breakpoint at u.bptaddr. */ - NOTIFY_AUTOBPT, /* Breakpoint at u.bptaddr is automatically - inserted. */ - NOTIFY_SYSCALL /* System call u.syscallno will be invoked. */ -} td_notify_e; - -/* Description how event type is reported. */ -typedef struct td_notify -{ - td_notify_e type; /* Way the event is reported. */ - union - { - psaddr_t bptaddr; /* Address of breakpoint. */ - int syscallno; /* Number of system call used. */ - } u; -} td_notify_t; - -/* Structure used to report event. */ -typedef struct td_event_msg -{ - td_event_e event; /* Event type being reported. */ - const td_thrhandle_t *th_p; /* Thread reporting the event. */ - union - { -# if 0 - td_synchandle_t *sh; /* Handle of synchronization object. */ -#endif - uintptr_t data; /* Event specific data. */ - } msg; -} td_event_msg_t; - -/* Structure containing event data available in each thread structure. */ -typedef struct -{ - td_thr_events_t eventmask; /* Mask of enabled events. */ - td_event_e eventnum; /* Number of last event. */ - void *eventdata; /* Data associated with event. */ -} td_eventbuf_t; - - -/* Gathered statistics about the process. */ -typedef struct td_ta_stats -{ - int nthreads; /* Total number of threads in use. */ - int r_concurrency; /* Concurrency level requested by user. */ - int nrunnable_num; /* Average runnable threads, numerator. */ - int nrunnable_den; /* Average runnable threads, denominator. */ - int a_concurrency_num; /* Achieved concurrency level, numerator. */ - int a_concurrency_den; /* Achieved concurrency level, denominator. */ - int nlwps_num; /* Average number of processes in use, - numerator. */ - int nlwps_den; /* Average number of processes in use, - denominator. */ - int nidle_num; /* Average number of idling processes, - numerator. */ - int nidle_den; /* Average number of idling processes, - denominator. */ -} td_ta_stats_t; - - -/* Since Sun's library is based on Solaris threads we have to define a few - types to map them to POSIX threads. */ -typedef pthread_t thread_t; -typedef pthread_key_t thread_key_t; - - -/* Callback for iteration over threads. */ -typedef int td_thr_iter_f (const td_thrhandle_t *, void *); - -/* Callback for iteration over thread local data. */ -typedef int td_key_iter_f (thread_key_t, void (*) (void *), void *); - - - -/* Forward declaration. This has to be defined by the user. */ -struct ps_prochandle; - - -/* Information about the thread. */ -typedef struct td_thrinfo -{ - td_thragent_t *ti_ta_p; /* Process handle. */ - unsigned int ti_user_flags; /* Unused. */ - thread_t ti_tid; /* Thread ID returned by - pthread_create(). */ - char *ti_tls; /* Pointer to thread-local data. */ - psaddr_t ti_startfunc; /* Start function passed to - pthread_create(). */ - psaddr_t ti_stkbase; /* Base of thread's stack. */ - long int ti_stksize; /* Size of thread's stack. */ - psaddr_t ti_ro_area; /* Unused. */ - int ti_ro_size; /* Unused. */ - td_thr_state_e ti_state; /* Thread state. */ - unsigned char ti_db_suspended; /* Nonzero if suspended by debugger. */ - td_thr_type_e ti_type; /* Type of the thread (system vs - user thread). */ - intptr_t ti_pc; /* Unused. */ - intptr_t ti_sp; /* Unused. */ - short int ti_flags; /* Unused. */ - int ti_pri; /* Thread priority. */ - lwpid_t ti_lid; /* Kernel PID for this thread. */ - sigset_t ti_sigmask; /* Signal mask. */ - unsigned char ti_traceme; /* Nonzero if event reporting - enabled. */ - unsigned char ti_preemptflag; /* Unused. */ - unsigned char ti_pirecflag; /* Unused. */ - sigset_t ti_pending; /* Set of pending signals. */ - td_thr_events_t ti_events; /* Set of enabled events. */ -} td_thrinfo_t; - - - -/* Prototypes for exported library functions. */ - -/* Initialize the thread debug support library. */ -extern td_err_e td_init (void); - -/* Historical relict. Should not be used anymore. */ -extern td_err_e td_log (void); - -/* Return list of symbols the library can request. */ -extern const char **td_symbol_list (void); - -/* Generate new thread debug library handle for process PS. */ -extern td_err_e td_ta_new (struct ps_prochandle *__ps, td_thragent_t **__ta); - -/* Free resources allocated for TA. */ -extern td_err_e td_ta_delete (td_thragent_t *__ta); - -/* Get number of currently running threads in process associated with TA. */ -extern td_err_e td_ta_get_nthreads (const td_thragent_t *__ta, int *__np); - -/* Return process handle passed in `td_ta_new' for process associated with - TA. */ -extern td_err_e td_ta_get_ph (const td_thragent_t *__ta, - struct ps_prochandle **__ph); - -/* Map thread library handle PT to thread debug library handle for process - associated with TA and store result in *TH. */ -extern td_err_e td_ta_map_id2thr (const td_thragent_t *__ta, pthread_t __pt, - td_thrhandle_t *__th); - -/* Map process ID LWPID to thread debug library handle for process - associated with TA and store result in *TH. */ -extern td_err_e td_ta_map_lwp2thr (const td_thragent_t *__ta, lwpid_t __lwpid, - td_thrhandle_t *__th); - - -/* Call for each thread in a process associated with TA the callback function - CALLBACK. */ -extern td_err_e td_ta_thr_iter (const td_thragent_t *__ta, - td_thr_iter_f *__callback, void *__cbdata_p, - td_thr_state_e __state, int __ti_pri, - sigset_t *__ti_sigmask_p, - unsigned int __ti_user_flags); - -/* Call for each defined thread local data entry the callback function KI. */ -extern td_err_e td_ta_tsd_iter (const td_thragent_t *__ta, td_key_iter_f *__ki, - void *__p); - - -/* Get event address for EVENT. */ -extern td_err_e td_ta_event_addr (const td_thragent_t *__ta, - td_event_e __event, td_notify_t *__ptr); - -/* Enable EVENT in global mask. */ -extern td_err_e td_ta_set_event (const td_thragent_t *__ta, - td_thr_events_t *__event); - -/* Disable EVENT in global mask. */ -extern td_err_e td_ta_clear_event (const td_thragent_t *__ta, - td_thr_events_t *__event); - -/* Return information about last event. */ -extern td_err_e td_ta_event_getmsg (const td_thragent_t *__ta, - td_event_msg_t *__msg); - - -/* Set suggested concurrency level for process associated with TA. */ -extern td_err_e td_ta_setconcurrency (const td_thragent_t *__ta, int __level); - - -/* Enable collecting statistics for process associated with TA. */ -extern td_err_e td_ta_enable_stats (const td_thragent_t *__ta, int __enable); - -/* Reset statistics. */ -extern td_err_e td_ta_reset_stats (const td_thragent_t *__ta); - -/* Retrieve statistics from process associated with TA. */ -extern td_err_e td_ta_get_stats (const td_thragent_t *__ta, - td_ta_stats_t *__statsp); - - -/* Validate that TH is a thread handle. */ -extern td_err_e td_thr_validate (const td_thrhandle_t *__th); - -/* Return information about thread TH. */ -extern td_err_e td_thr_get_info (const td_thrhandle_t *__th, - td_thrinfo_t *__infop); - -/* Retrieve floating-point register contents of process running thread TH. */ -extern td_err_e td_thr_getfpregs (const td_thrhandle_t *__th, - prfpregset_t *__regset); - -/* Retrieve general register contents of process running thread TH. */ -extern td_err_e td_thr_getgregs (const td_thrhandle_t *__th, - prgregset_t __gregs); - -/* Retrieve extended register contents of process running thread TH. */ -extern td_err_e td_thr_getxregs (const td_thrhandle_t *__th, void *__xregs); - -/* Get size of extended register set of process running thread TH. */ -extern td_err_e td_thr_getxregsize (const td_thrhandle_t *__th, int *__sizep); - -/* Set floating-point register contents of process running thread TH. */ -extern td_err_e td_thr_setfpregs (const td_thrhandle_t *__th, - const prfpregset_t *__fpregs); - -/* Set general register contents of process running thread TH. */ -extern td_err_e td_thr_setgregs (const td_thrhandle_t *__th, - prgregset_t __gregs); - -/* Set extended register contents of process running thread TH. */ -extern td_err_e td_thr_setxregs (const td_thrhandle_t *__th, - const void *__addr); - - -/* Get address of the given module's TLS storage area for the given thread. */ -extern td_err_e td_thr_tlsbase (const td_thrhandle_t *__th, - unsigned long int __modid, - psaddr_t *__base); - -/* Get address of thread local variable. */ -extern td_err_e td_thr_tls_get_addr (const td_thrhandle_t *__th, - psaddr_t __map_address, size_t __offset, - psaddr_t *__address); - - -/* Enable reporting for EVENT for thread TH. */ -extern td_err_e td_thr_event_enable (const td_thrhandle_t *__th, int __event); - -/* Enable EVENT for thread TH. */ -extern td_err_e td_thr_set_event (const td_thrhandle_t *__th, - td_thr_events_t *__event); - -/* Disable EVENT for thread TH. */ -extern td_err_e td_thr_clear_event (const td_thrhandle_t *__th, - td_thr_events_t *__event); - -/* Get event message for thread TH. */ -extern td_err_e td_thr_event_getmsg (const td_thrhandle_t *__th, - td_event_msg_t *__msg); - - -/* Set priority of thread TH. */ -extern td_err_e td_thr_setprio (const td_thrhandle_t *__th, int __prio); - - -/* Set pending signals for thread TH. */ -extern td_err_e td_thr_setsigpending (const td_thrhandle_t *__th, - unsigned char __n, const sigset_t *__ss); - -/* Set signal mask for thread TH. */ -extern td_err_e td_thr_sigsetmask (const td_thrhandle_t *__th, - const sigset_t *__ss); - - -/* Return thread local data associated with key TK in thread TH. */ -extern td_err_e td_thr_tsd (const td_thrhandle_t *__th, - const thread_key_t __tk, void **__data); - - -/* Suspend execution of thread TH. */ -extern td_err_e td_thr_dbsuspend (const td_thrhandle_t *__th); - -/* Resume execution of thread TH. */ -extern td_err_e td_thr_dbresume (const td_thrhandle_t *__th); - -#endif /* thread_db.h */ diff --git a/nptl_db/thread_dbP.h b/nptl_db/thread_dbP.h index bcb2764074..cf6a2b0221 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-2018 Free Software Foundation, Inc. + Copyright (C) 2003-2019 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 @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ + <https://www.gnu.org/licenses/>. */ #ifndef _THREAD_DBP_H #define _THREAD_DBP_H 1 @@ -37,12 +37,14 @@ enum { # define DB_STRUCT(type) SYM_SIZEOF_##type, # define DB_STRUCT_FIELD(type, field) SYM_##type##_FIELD_##field, +# define DB_STRUCT_FLEXIBLE_ARRAY(type, field) DB_STRUCT_FIELD (type, field) # define DB_SYMBOL(name) SYM_##name, # define DB_FUNCTION(name) SYM_##name, # define DB_VARIABLE(name) SYM_##name, SYM_DESC_##name, # include "structs.def" # undef DB_STRUCT # undef DB_STRUCT_FIELD +# undef DB_STRUCT_FLEXIBLE_ARRAY # undef DB_SYMBOL # undef DB_FUNCTION # undef DB_VARIABLE @@ -90,6 +92,7 @@ struct td_thragent uint32_t ta_sizeof_##type; # define DB_STRUCT_FIELD(type, field) \ db_desc_t ta_field_##type##_##field; +# define DB_STRUCT_FLEXIBLE_ARRAY(type, field) DB_STRUCT_FIELD (type, field) # define DB_SYMBOL(name) \ psaddr_t ta_addr_##name; # define DB_FUNCTION(name) \ @@ -100,6 +103,7 @@ struct td_thragent # include "structs.def" # undef DB_STRUCT # undef DB_STRUCT_FIELD +# undef DB_STRUCT_FLEXIBLE_ARRAY # undef DB_FUNCTION # undef DB_SYMBOL # undef DB_VARIABLE |