From owner-p4-projects@FreeBSD.ORG Thu Mar 11 21:58:18 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 86AAB16A4D0; Thu, 11 Mar 2004 21:58:18 -0800 (PST) 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 40FCB16A4CE for ; Thu, 11 Mar 2004 21:58:18 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2456443D45 for ; Thu, 11 Mar 2004 21:58:18 -0800 (PST) (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 i2C5wCGe061975 for ; Thu, 11 Mar 2004 21:58:12 -0800 (PST) (envelope-from marcel@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i2C5wBxV061972 for perforce@freebsd.org; Thu, 11 Mar 2004 21:58:11 -0800 (PST) (envelope-from marcel@freebsd.org) Date: Thu, 11 Mar 2004 21:58:11 -0800 (PST) Message-Id: <200403120558.i2C5wBxV061972@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 48765 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: Fri, 12 Mar 2004 05:58:19 -0000 http://perforce.freebsd.org/chv.cgi?CH=48765 Change 48765 by marcel@marcel_nfs on 2004/03/11 21:57:54 Add an active field to the KDB backend structure and the GDB debug port structure. Meaning of these are: -1 backend or port is dead, 0 backend or port is inactive, >0 backend or port is active. Use the active field to iterate over the linker set and display probed backends or ports. Initialize the GDB debug port after probing. uart(4) now properly displays: uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 on acpi0 uart0: debug port (115200,n,8,1) Affected files ... .. //depot/projects/gdb/sys/gdb/gdb.h#3 edit .. //depot/projects/gdb/sys/gdb/gdb_main.c#2 edit .. //depot/projects/gdb/sys/kern/subr_kdb.c#4 edit .. //depot/projects/gdb/sys/sys/kdb.h#3 edit Differences ... ==== //depot/projects/gdb/sys/gdb/gdb.h#3 (text+ko) ==== @@ -44,6 +44,7 @@ gdb_probe_f *gdb_probe; gdb_putc_f *gdb_putc; gdb_term_f *gdb_term; + int gdb_active; }; #define GDB_DBGPORT(name, probe, init, term, checkc, getc, putc) \ @@ -58,4 +59,6 @@ }; \ DATA_SET(gdb_dbgport_set, name##_gdb_dbgport) +extern struct gdb_dbgport *gdb_cur; + #endif /* !_GDB_GDB_H_ */ ==== //depot/projects/gdb/sys/gdb/gdb_main.c#2 (text+ko) ==== @@ -55,22 +55,27 @@ SET_FOREACH(iter, gdb_dbgport_set) { dp = *iter; pri = (dp->gdb_probe != NULL) ? dp->gdb_probe() : -1; - if (pri >= 0) { - if (cur_pri == -1) - printf("GDB: debug ports:"); - printf(" %s", dp->gdb_name); - if (pri > cur_pri) { - cur_pri = pri; - gdb_cur = dp; - } + dp->gdb_active = (pri >= 0) ? 0 : -1; + if (pri > cur_pri) { + cur_pri = pri; + gdb_cur = dp; } } - if (cur_pri != -1) { + if (gdb_cur != NULL) { + printf("GDB: debug ports:"); + SET_FOREACH(iter, gdb_dbgport_set) { + dp = *iter; + if (dp->gdb_active == 0) + printf(" %s", dp->gdb_name); + } printf("\n"); - printf("GDB: current=%s\n", gdb_cur->gdb_name); } else printf("GDB: no debug ports present\n"); - return ((cur_pri == -1) ? 0 : 1); + if (gdb_cur != NULL) { + gdb_cur->gdb_init(); + printf("GDB: current port: %s\n", gdb_cur->gdb_name); + } + return ((gdb_cur != NULL) ? 1 : 0); } static int ==== //depot/projects/gdb/sys/kern/subr_kdb.c#4 (text+ko) ==== @@ -133,21 +133,23 @@ SET_FOREACH(iter, kdb_dbbe_set) { be = *iter; pri = (be->dbbe_init != NULL) ? be->dbbe_init() : -1; - if (pri >= 0) { - if (cur_pri == -1) - printf("KDB: debugger backends:"); - printf(" %s", be->dbbe_name); - if (pri > cur_pri) { - cur_pri = pri; - kdb_cur = be; - } + be->dbbe_active = (pri >= 0) ? 0 : -1; + if (pri > cur_pri) { + cur_pri = pri; + kdb_cur = be; } } - if (cur_pri != -1) { + if (kdb_cur != NULL) { + printf("KDB: debugger backends:"); + SET_FOREACH(iter, kdb_dbbe_set) { + be = *iter; + if (be->dbbe_active == 0) + printf(" %s", be->dbbe_name); + } printf("\n"); - printf("KDB: current=%s\n", kdb_cur->dbbe_name); - } else - printf("KDB: no debugger backends present\n"); + printf("KDB: current backend: %s\n", + kdb_cur->dbbe_name); + } } /* ==== //depot/projects/gdb/sys/sys/kdb.h#3 (text+ko) ==== @@ -42,6 +42,7 @@ dbbe_init_f *dbbe_init; dbbe_trace_f *dbbe_trace; dbbe_trap_f *dbbe_trap; + int dbbe_active; }; #define KDB_BACKEND(name, init, trace, enter, trap) \