From owner-p4-projects@FreeBSD.ORG Fri May 7 22:19:12 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6B56216A4D0; Fri, 7 May 2004 22:19:12 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 28B2E16A4CE for ; Fri, 7 May 2004 22:19:12 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id F254B43D39 for ; Fri, 7 May 2004 22:19:11 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i485JBGe065299 for ; Fri, 7 May 2004 22:19:11 -0700 (PDT) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i485JBOS065295 for perforce@freebsd.org; Fri, 7 May 2004 22:19:11 -0700 (PDT) (envelope-from marcel@freebsd.org) Date: Fri, 7 May 2004 22:19:11 -0700 (PDT) Message-Id: <200405080519.i485JBOS065295@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar To: Perforce Change Reviews Subject: PERFORCE change 52494 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 May 2004 05:19:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=52494 Change 52494 by marcel@marcel_nfs on 2004/05/07 22:18:41 Rewrite the handling of threads to use the new thread support functions. Affected files ... .. //depot/projects/gdb/sys/gdb/gdb_main.c#14 edit Differences ... ==== //depot/projects/gdb/sys/gdb/gdb_main.c#14 (text+ko) ==== @@ -92,7 +92,7 @@ static int gdb_trap(int type, int code) { - struct proc *thr_iter; + struct thread *thr_iter; /* * Send a T packet. We currently do not support watchpoints (the @@ -138,10 +138,17 @@ break; case 'H': { /* Set thread. */ intmax_t tid; + struct thread *thr; gdb_rx_char(); gdb_rx_varhex(&tid); - if (tid > 0) - kdb_set_thread(tid); + if (tid > 0) { + thr = kdb_thr_lookup(tid); + if (thr == NULL) { + gdb_tx_err(ENOENT); + break; + } + kdb_thr_select(thr); + } gdb_tx_ok(); break; } @@ -176,19 +183,19 @@ } case 'q': /* General query. */ if (gdb_rx_equal("fThreadInfo")) { - thr_iter = LIST_FIRST(&allproc); + thr_iter = kdb_thr_first(); gdb_tx_begin('m'); - gdb_tx_hex(thr_iter->p_pid, 8); + gdb_tx_hex(thr_iter->td_tid, 8); gdb_tx_end(); } else if (gdb_rx_equal("sThreadInfo")) { if (thr_iter == NULL) { gdb_tx_err(ENXIO); break; } - thr_iter = LIST_NEXT(thr_iter, p_list); + thr_iter = kdb_thr_next(thr_iter); if (thr_iter != NULL) { gdb_tx_begin('m'); - gdb_tx_hex(thr_iter->p_pid, 8); + gdb_tx_hex(thr_iter->td_tid, 8); gdb_tx_end(); } else { gdb_tx_begin('l'); @@ -206,14 +213,11 @@ } case 'T': { /* Thread alive. */ intmax_t tid; - pid_t curtid; gdb_rx_varhex(&tid); - curtid = kdb_thread->td_tid; - if (kdb_set_thread(tid)) + if (kdb_thr_lookup(tid) != NULL) gdb_tx_ok(); else gdb_tx_err(ENOENT); - kdb_set_thread(curtid); break; } case -1: