diff options
author | glebius <glebius@FreeBSD.org> | 2019-06-04 12:17:26 +0800 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2019-06-04 12:17:26 +0800 |
commit | 4d64da578f47e07a030591026b92efbfc0c34070 (patch) | |
tree | 02ac813307958c3e59fda68efb61c3bb8dbe3130 | |
parent | 931a4448f1fc3fbf0bc2c4d02e0bbc9e3cb85292 (diff) | |
download | freebsd-ports-gnome-4d64da578f47e07a030591026b92efbfc0c34070.tar.gz freebsd-ports-gnome-4d64da578f47e07a030591026b92efbfc0c34070.tar.zst freebsd-ports-gnome-4d64da578f47e07a030591026b92efbfc0c34070.zip |
Unreverse the thread list for 'info threads' internal command. Now it
will match the natural order of tailq, and thus output of 'ps' macro
from tools/debugscripts/gdbinit.kernel.
Reviewed by: pizzamig (maintainer), jhb
-rw-r--r-- | devel/gdb/Makefile | 2 | ||||
-rw-r--r-- | devel/gdb/files/kgdb/fbsd-kthr.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/devel/gdb/Makefile b/devel/gdb/Makefile index 67a2e9e0b872..9868c7129747 100644 --- a/devel/gdb/Makefile +++ b/devel/gdb/Makefile @@ -3,7 +3,7 @@ PORTNAME= gdb PORTVERSION= 8.3 -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= GNU diff --git a/devel/gdb/files/kgdb/fbsd-kthr.c b/devel/gdb/files/kgdb/fbsd-kthr.c index 648fcfb0d8f6..6e2cbaee204e 100644 --- a/devel/gdb/files/kgdb/fbsd-kthr.c +++ b/devel/gdb/files/kgdb/fbsd-kthr.c @@ -44,7 +44,7 @@ static LONGEST dumptid; static CORE_ADDR stopped_cpus; static LONGEST mp_maxid; -static struct kthr *first; +static struct kthr *first, *last; struct kthr *curkthr; static int proc_off_p_pid, proc_off_p_comm, proc_off_p_list, proc_off_p_threads; @@ -131,7 +131,11 @@ kgdb_thr_add_procs(CORE_ADDR paddr, CORE_ADDR (*cpu_pcb_addr) (u_int)) break; } END_CATCH kt = XNEW (struct kthr); - kt->next = first; + if (last == NULL) + first = last = kt; + else + last->next = kt; + kt->next = NULL; kt->kaddr = tdaddr; if (tid == dumptid) kt->pcb = dumppcb; @@ -143,7 +147,7 @@ kgdb_thr_add_procs(CORE_ADDR paddr, CORE_ADDR (*cpu_pcb_addr) (u_int)) kt->pid = pid; kt->paddr = paddr; kt->cpu = oncpu; - first = kt; + last = kt; tdaddr = tdnext; } paddr = pnext; @@ -163,6 +167,7 @@ kgdb_thr_init(CORE_ADDR (*cpu_pcb_addr) (u_int)) first = kt->next; free(kt); } + last = NULL; addr = kgdb_lookup("allproc"); if (addr == 0) |