Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jun 2019 04:17:27 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r503436 - in head/devel/gdb: . files/kgdb
Message-ID:  <201906040417.x544HRfM081074@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius (src committer)
Date: Tue Jun  4 04:17:26 2019
New Revision: 503436
URL: https://svnweb.freebsd.org/changeset/ports/503436

Log:
  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

Modified:
  head/devel/gdb/Makefile
  head/devel/gdb/files/kgdb/fbsd-kthr.c

Modified: head/devel/gdb/Makefile
==============================================================================
--- head/devel/gdb/Makefile	Tue Jun  4 04:01:16 2019	(r503435)
+++ head/devel/gdb/Makefile	Tue Jun  4 04:17:26 2019	(r503436)
@@ -3,7 +3,7 @@
 
 PORTNAME=	gdb
 PORTVERSION=	8.3
-PORTREVISION=	0
+PORTREVISION=	1
 CATEGORIES=	devel
 MASTER_SITES=	GNU
 

Modified: head/devel/gdb/files/kgdb/fbsd-kthr.c
==============================================================================
--- head/devel/gdb/files/kgdb/fbsd-kthr.c	Tue Jun  4 04:01:16 2019	(r503435)
+++ head/devel/gdb/files/kgdb/fbsd-kthr.c	Tue Jun  4 04:17:26 2019	(r503436)
@@ -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_pc
 				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_pc
 			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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201906040417.x544HRfM081074>