FreeBSD Bugzilla – Attachment 128714 Details for
Bug 172572
[patch] devel/gdb: add missing thread names
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.00 KB, created by
nkoch
on 2012-10-10 13:00:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
nkoch
Created:
2012-10-10 13:00:01 UTC
Size:
2.00 KB
patch
obsolete
>--- gdb.org/Makefile 2012-10-02 08:40:29.000000000 +0200 >+++ gdb/Makefile 2012-10-10 13:34:42.000000000 +0200 >@@ -7,7 +7,7 @@ > > PORTNAME= gdb > PORTVERSION= 7.5 >-PORTREVISION= 1 >+PORTREVISION= 2 > CATEGORIES= devel > MASTER_SITES= GNU > >--- gdb.org/files/fbsd-threads.c 2012-08-28 09:24:15.000000000 +0200 >+++ gdb/files/fbsd-threads.c 2012-10-10 13:34:18.000000000 +0200 >@@ -431,6 +431,46 @@ > fbsd_thread_present = 0; > } > >+static char * >+fbsd_thread_get_name (lwpid_t lwpid) >+{ >+ static char last_thr_name[MAXCOMLEN + 1]; >+ char section_name[32]; >+ struct ptrace_lwpinfo lwpinfo; >+ bfd_size_type size; >+ struct bfd_section *section; >+ >+ if (target_has_execution) >+ { >+ if (ptrace (PT_LWPINFO, lwpid, (caddr_t)&lwpinfo, sizeof (lwpinfo)) == -1) >+ goto fail; >+ strncpy (last_thr_name, lwpinfo.pl_tdname, sizeof (last_thr_name) - 1); >+ } >+ else >+ { >+ snprintf (section_name, sizeof (section_name), ".tname/%u", lwpid); >+ section = bfd_get_section_by_name (core_bfd, section_name); >+ if (! section) >+ goto fail; >+ >+ /* Section size fix-up. */ >+ size = bfd_section_size (core_bfd, section); >+ if (size > sizeof (last_thr_name)) >+ size = sizeof (last_thr_name); >+ >+ if (! bfd_get_section_contents (core_bfd, section, last_thr_name, >+ (file_ptr)0, size)) >+ goto fail; >+ if (last_thr_name[0] == '\0') >+ goto fail; >+ } >+ last_thr_name[sizeof (last_thr_name) - 1] = '\0'; >+ return last_thr_name; >+fail: >+ strcpy (last_thr_name, "<unknown>"); >+ return last_thr_name; >+} >+ > static void > check_for_thread_db (void) > { >@@ -1114,8 +1154,9 @@ > > if (ti.ti_lid != 0) > { >- snprintf (buf, sizeof (buf), "Thread %llx (LWP %d)", >- (unsigned long long)th.th_thread, ti.ti_lid); >+ snprintf (buf, sizeof (buf), "Thread %llx (LWP %d/%s)", >+ (unsigned long long)th.th_thread, ti.ti_lid, >+ fbsd_thread_get_name (ti.ti_lid)); > } > else > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 172572
: 128714