* mainDynamic.cxx (main): Call add_board in place of add_child.
* commonCfg.h (add_gdb): New method of SessionCfg.
(add_board): Ditto.
(write_config): Ditto.
(board_count): New member of SessionCfg.
(gdb_count): Ditto.
* commonCfg.cxx (SessionCfg): Initialize board_count and gdb_count.
(SessionCfg::write_config): New method.
(set_gdb): Call sess->add_gdb.
+2004-03-22 Dave Brolley <brolley@redhat.com>
+
+ * mainDynamic.cxx (main): Call add_board in place of add_child.
+ * commonCfg.h (add_gdb): New method of SessionCfg.
+ (add_board): Ditto.
+ (write_config): Ditto.
+ (board_count): New member of SessionCfg.
+ (gdb_count): Ditto.
+ * commonCfg.cxx (SessionCfg): Initialize board_count and gdb_count.
+ (SessionCfg::write_config): New method.
+ (set_gdb): Call sess->add_gdb.
+
2003-10-26 Dave Brolley <brolley@redhat.com>
* commonCfg.cxx (BoardCfg): Initialize 'gprof'.
tcl_bridge (NULL),
loader (NULL),
verbose (false),
- use_stdio (true)
+ use_stdio (true),
+ board_count (0),
+ gdb_count (0)
{
add_child (host_sched);
add_child (sim_sched);
init_seq->add_output (7, tcl_bridge, "!event");
}
+void SessionCfg::write_config (Writer &w)
+{
+ AggregateCfg::write_config (w);
+
+ // Stop the host scheduler if all of the GDB stubs are stopped
+ if (gdb_count)
+ {
+ assert (host_sched);
+ Setting (host_sched, "yield-host-time-threshold",
+ sidutil::make_attribute (gdb_count)).write_to (w);
+ Setting (host_sched, "yield-host-time?", "0").write_to (w);
+ }
+
+ // Stop the sim scheduler if any of the GDB stubs are stopped
+ assert (sim_sched);
+ Setting (sim_sched, "enable-threshold",
+ sidutil::make_attribute (board_count)).write_to (w);
+ Setting (sim_sched, "enabled?",
+ sidutil::make_attribute (board_count)).write_to (w);
+}
// LoaderCfg
LoaderCfg::~LoaderCfg () {}
gdb = new GdbCfg ("gdb", port, cpu, this, sess);
add_child (gdb);
sess->use_no_stdio ();
+ sess->add_gdb ();
}
// you should really only make one of these, with an empty name,
// unless you want some crazy multi-session support.
+class BoardCfg;
class LoaderCfg;
struct SessionCfg :
bool use_stdio;
void add_ulog_file (const string filename);
map<const string, AtomicCfg *> ulog_map;
+ void add_gdb () { ++gdb_count; }
+ void add_board (ComponentCfg *b) { ++board_count; add_child (b); }
+ virtual void write_config (Writer &w);
+private:
+ sid::host_int_4 board_count;
+ sid::host_int_4 gdb_count;
};
class CpuCfg :
virtual ~GprofCfg ();
};
-class BoardCfg;
class GdbCfg :
virtual public AggregateCfg
{
// mainDynamic.cxx - high-tech mainline. -*- C++ -*-
-// Copyright (C) 1999, 2000, 2001, 2002, 2003 Red Hat.
+// Copyright (C) 1999-2004 Red Hat.
// This file is part of SID and is licensed under the GPL.
// See the file COPYING.SID for conditions for redistribution.
{
need_sess (sess);
if (curr_board)
- sess->add_child (curr_board);
+ sess->add_board (curr_board);
curr_board = NULL;
string new_board_type = optstring();
string new_board_name (new_board_type + "-" +
}
if (sess && curr_board)
- sess->add_child (curr_board);
+ sess->add_board (curr_board);
if (persistent_p)
config_items.push_back (make_pair (false, string("set main persistent? true")));