Author: mizhka
Date: Mon Oct  2 20:33:16 2017
New Revision: 324219
URL: https://svnweb.freebsd.org/changeset/base/324219

Log:
  [libthr] revert change of visibility of _thread_keytable to unbreak debugger
  
  Fix regression by r318539. The sysutils/pstack uses library libthread_db to
  read information about threads state. The function pt_ta_new makes lookup of
  several key symbols including _thread_keytable. But r318539 mades this field
  static. It causes silent ignore of libthr library by pstack and as result
  sysutils/pstack doesn't output any thread information.
  
  This fix changes this field back to non-static.
  
  MFC after:    2 weeks
  Differential Revision:        https://reviews.freebsd.org/D11738

Modified:
  head/lib/libthr/thread/thr_private.h
  head/lib/libthr/thread/thr_spec.c

Modified: head/lib/libthr/thread/thr_private.h
==============================================================================
--- head/lib/libthr/thread/thr_private.h        Mon Oct  2 20:02:25 2017        
(r324218)
+++ head/lib/libthr/thread/thr_private.h        Mon Oct  2 20:33:16 2017        
(r324219)
@@ -719,6 +719,8 @@ extern char         *_usrstack __hidden;
 extern int             _libthr_debug;
 extern int             _thread_event_mask;
 extern struct pthread  *_thread_last_event;
+/* Used in symbol lookup of libthread_db */
+extern struct pthread_key      _thread_keytable[];
 
 /* List of all threads: */
 extern pthreadlist     _thread_list;

Modified: head/lib/libthr/thread/thr_spec.c
==============================================================================
--- head/lib/libthr/thread/thr_spec.c   Mon Oct  2 20:02:25 2017        
(r324218)
+++ head/lib/libthr/thread/thr_spec.c   Mon Oct  2 20:33:16 2017        
(r324219)
@@ -42,7 +42,8 @@ __FBSDID("$FreeBSD$");
 
 #include "thr_private.h"
 
-static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
+/* Used in symbol lookup of libthread_db */
+struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
 
 __weak_reference(_pthread_key_create, pthread_key_create);
 __weak_reference(_pthread_key_delete, pthread_key_delete);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to