Date: Sat, 12 Jun 2004 07:47:04 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 54710 for review Message-ID: <200406120747.i5C7l4Sd001546@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=54710 Change 54710 by marcel@marcel_nfs on 2004/06/12 07:46:55 o Instruct gdb(1) to load the kernel image. That way it has all the debug information it needs, including the symbols. o Exit the main loop when gdb_packet_dat() tells us to. Affected files ... .. //depot/projects/gdb/usr.bin/kgdb/main.c#10 edit Differences ... ==== //depot/projects/gdb/usr.bin/kgdb/main.c#10 (text+ko) ==== @@ -192,7 +192,7 @@ ssize_t sz; int fdin, fdout; int f, nfds, status; - int ch; + int ch, done; dumpnr = -1; @@ -274,6 +274,10 @@ if (write(cmdfile_fd, cmd_set_prompt, sizeof(cmd_set_prompt) - 1) < 0) err(1, "write(2)"); + sz = snprintf(buf, sizeof(buf), "file %s\n", kernel); + if (write(cmdfile_fd, buf, sz) < 0) + err(1, "write(2)"); + if (openpty(&gdb_rp_fd, &f, buf, NULL, NULL) == -1) err(1, "openpty(3)"); close(f); @@ -311,7 +315,8 @@ nfds = (gdb_rp_fd > nfds) ? gdb_rp_fd : nfds; nfds++; - while (1) { + done = 0; + while (!done) { FD_ZERO(&rfds); FD_ZERO(&wfds); FD_ZERO(&xfds); @@ -340,7 +345,7 @@ if (FD_ISSET(gdb_rp_fd, &rfds)) { sz = read(gdb_rp_fd, buf, sizeof(buf)); if (sz > 0) - gdb_packet_data(buf, sz); + done = gdb_packet_data(buf, sz); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200406120747.i5C7l4Sd001546>