Date: Tue, 11 May 2004 21:20:17 -0700 (PDT) From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 52703 for review Message-ID: <200405120420.i4C4KH6o064899@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=52703 Change 52703 by marcel@marcel_nfs on 2004/05/11 21:19:21 Add kdb_reenter(). This function is called by the trap handler when a trap happens while in the debugger (i.e. kdb_active is non-zero). The advantage of a seperate function for this is that it can also be called from other places than trap handlers. Affected files ... .. //depot/projects/gdb/sys/kern/subr_kdb.c#13 edit .. //depot/projects/gdb/sys/sys/kdb.h#10 edit Differences ... ==== //depot/projects/gdb/sys/kern/subr_kdb.c#13 (text+ko) ==== @@ -259,6 +259,17 @@ return (old); } +void +kdb_reenter(void) +{ + + if (!kdb_active || kdb_jmpbufp == NULL) + return; + + longjmp(kdb_jmpbufp, 1); + /* NOTREACHED */ +} + /* * Thread related support functions. */ @@ -333,14 +344,12 @@ if (kdb_dbbe == NULL || kdb_dbbe->dbbe_trap == NULL) return (0); + /* We reenter the debugger through kdb_reenter(). */ + if (kdb_active) + return (0); + critical_enter(); - /* Check for recursion. */ - if (kdb_active && kdb_jmpbufp != NULL) { - critical_exit(); - longjmp(kdb_jmpbufp, 1); - } - kdb_active++; kdb_thread = curthread; kdb_frame = tf; ==== //depot/projects/gdb/sys/sys/kdb.h#10 (text+ko) ==== @@ -65,6 +65,7 @@ void kdb_enter(const char *); void kdb_init(void); void * kdb_jmpbuf(jmp_buf); +void kdb_reenter(void); struct thread *kdb_thr_first(void); struct thread *kdb_thr_lookup(pid_t); struct thread *kdb_thr_next(struct thread *);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405120420.i4C4KH6o064899>