Re: [patch][rfa] Multi core debugging with GDB
Dave Brolley <[email protected]>
| Newsgroups | gmane.comp.emulators.sid.devel |
|---|---|
| Message-ID | <[email protected]> |
And here's the modified patch for socketio.cxx Dave Brolley wrote: > Approved by fche and committed with the attached modification to > ensure that all data gets flushed. > > Dave Brolley wrote: > >> Hi, >> >> Debugging multiple cores with multiple instances of GDB within a >> simulation is currently possible by specifying a separate --gdb >> option after each --board and specifying a different port for each >> GDB instance. The simulation ends (as it does without GDB) when the >> first core exits. However, the other GDB instances all report >> "Watchdog expired. Target disconnected". This was because of three >> problems: >> >> 1) The "enabled?", "enable-threshold", "yield-host-time?" and >> "yield-host-time-threshold" of the host scheduler were not being set. >> This caused the host scheduler to yield host time after the first GDB >> stub exited. >> >> 2) The other GDB stubs were not properly notifying their GDB clients >> that they were exiting >> >> 3) Even after proper notfication and yielding were implemented, the >> packets never reached their GDB clients because their socket >> components were never polled again which was because the host >> scheduler was never advanced again which was because the whole shut >> down process was initiated when the first GDB stub drove main's >> "stop!" pin. This problem is corrected by having the sockets do one >> final transmit when their "fini" pins are driven by shutdown-sequence. >> >> The result is an orderly shutdown of the GDB stubs and their clients. >> >> OK to commit? >> >> Dave > > > >
socket-flush.patch.txt
(text/plain, 1.2 KB)
Index: sid/component/consoles/socketio.cxx
===================================================================
RCS file: /cvs/src/src/sid/component/consoles/socketio.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -c -p -r1.5 -r1.6
*** sid/component/consoles/socketio.cxx 4 Mar 2002 20:38:56 -0000 1.5
--- sid/component/consoles/socketio.cxx 22 Mar 2004 21:26:44 -0000 1.6
***************
*** 1,7 ****
// socketio.cxx - A console that uses a socket to do its I/O.
// -*- C++ -*-
! // Copyright (C) 1999, 2000, 2002 Red Hat.
// This file is part of SID and is licensed under the GPL.
// See the file COPYING.SID for conditions for redistribution.
--- 1,7 ----
// socketio.cxx - A console that uses a socket to do its I/O.
// -*- C++ -*-
! // Copyright (C) 1999-2002, 2004 Red Hat.
// This file is part of SID and is licensed under the GPL.
// See the file COPYING.SID for conditions for redistribution.
*************** void
*** 297,302 ****
--- 297,306 ----
socketio::fini_handler (host_int_4)
{
this->poll_control.cancel ();
+
+ // Flush out any remaining data
+ while (this->connected_p && this->out_buffer.length() != 0)
+ this->poll_transmit ();
if (this->connected_p)
{