PERFORCE change 54710 for review
Marcel Moolenaar
marcel at FreeBSD.org
Sat Jun 12 07:47:31 GMT 2004
http://perforce.freebsd.org/chv.cgi?CH=54710
Change 54710 by marcel at 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);
}
}
More information about the p4-projects
mailing list