From 386b8dc8ef16197b3efa38f4bbbc98833ce7c2c6 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 11 Sep 2017 13:48:04 +0100 Subject: [PATCH] remove version checks hack --- nptl_db/td_ta_map_lwp2thr.c | 10 ++++++++-- nptl_db/td_ta_new.c | 9 ++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/nptl_db/td_ta_map_lwp2thr.c b/nptl_db/td_ta_map_lwp2thr.c index d34711d..85620cb 100644 --- a/nptl_db/td_ta_map_lwp2thr.c +++ b/nptl_db/td_ta_map_lwp2thr.c @@ -185,11 +185,17 @@ td_ta_map_lwp2thr (const td_thragent_t *ta_arg, sometimes contain garbage that would confuse us, left by the kernel at exec. So if it looks like initialization is incomplete, we only fake a special descriptor for the initial thread. */ - psaddr_t list; td_err_e err = DB_GET_SYMBOL (list, ta, __stack_user); if (err != TD_OK) - return err; + { + /* '__stack_user' is in pthread.so, so this always fails with + non-threaded programs. GDB hardcodes/assumes th_unique==0 + for the main thread - maybe we should instead return the fake + special descriptor for the initial thread here too. See + below. */ + return err; + } err = DB_GET_FIELD (list, ta, list, list_t, next, 0); if (err != TD_OK) diff --git a/nptl_db/td_ta_new.c b/nptl_db/td_ta_new.c index aec2356..40424ad 100644 --- a/nptl_db/td_ta_new.c +++ b/nptl_db/td_ta_new.c @@ -33,12 +33,18 @@ LIST_HEAD (__td_agent_list); td_err_e td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta) { +#if 0 psaddr_t versaddr; char versbuf[sizeof (VERSION)]; +#endif LOG ("td_ta_new"); - /* Check whether the versions match. */ + /* Check whether the versions match. + + XXX: Disabled because "nptl_version" currently lives in + libpthread.so. */ +#if 0 if (td_lookup (ps, SYM_nptl_version, &versaddr) != PS_OK) return TD_NOLIBTHREAD; if (ps_pdread (ps, versaddr, versbuf, sizeof (versbuf)) != PS_OK) @@ -47,6 +53,7 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta) if (memcmp (versbuf, VERSION, sizeof VERSION) != 0) /* Not the right version. */ return TD_VERSION; +#endif /* Fill in the appropriate information. */ *ta = (td_thragent_t *) calloc (1, sizeof (td_thragent_t)); -- 2.5.5