Skip to content

Commit 2c4cf15

Browse files
committed
WIP
1 parent ab2f2de commit 2c4cf15

File tree

2 files changed

+41
-18
lines changed

2 files changed

+41
-18
lines changed

src/sst/core/impl/interactive/simpleDebug.cc

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,25 @@
3030

3131
namespace SST::IMPL::Interactive {
3232

33+
// Static initialization
34+
//bool SimpleDebugger::done = false;
35+
bool SimpleDebugger::autoCompleteEnable = true;
36+
std::ofstream SimpleDebugger::loggingFile;
37+
std::ifstream SimpleDebugger::replayFile;
38+
std::string SimpleDebugger::loggingFilePath = "sst-console.out";
39+
std::string SimpleDebugger::replayFilePath = "sst-console.in";
40+
bool SimpleDebugger::enLogging = false;
41+
std::stringstream SimpleDebugger::injectedCommand;
42+
ExecState SimpleDebugger::eState = {};
43+
std::stack<ExecState> SimpleDebugger::eStack = {};
44+
bool SimpleDebugger::confirm = true;
45+
CommandRegistry SimpleDebugger::cmdRegistry;
46+
CommandHistoryBuffer SimpleDebugger::cmdHistoryBuf;
47+
CmdLineEditor SimpleDebugger::cmdLineEditor;
48+
LINE_ENTRY_MODE SimpleDebugger::line_entry_mode = LINE_ENTRY_MODE::NORMAL;
49+
uint32_t SimpleDebugger::verbosity = 0;
50+
51+
3352
SimpleDebugger::SimpleDebugger(Params& params) :
3453
InteractiveConsole()
3554
{
@@ -207,6 +226,8 @@ SimpleDebugger::SimpleDebugger(Params& params) :
207226

208227
// Callback for directory listing strings
209228
cmdLineEditor.set_listing_callback([this](std::list<std::string>& vec) { get_listing_strings(vec); });
229+
230+
210231
}
211232

212233
SimpleDebugger::~SimpleDebugger()
@@ -257,9 +278,10 @@ SimpleDebugger::execute(const std::string& msg)
257278
getCurrentSimCycle());
258279
printf("%s\n", msg.c_str());
259280

260-
if ( nullptr == obj_ ) {
281+
//if ( nullptr == obj_ ) {
261282
obj_ = getComponentObjectMap();
262-
}
283+
assert(obj_);
284+
//}
263285
done = false;
264286
retState = DONE;
265287

@@ -626,6 +648,7 @@ SimpleDebugger::cmd_pwd(std::vector<std::string>& UNUSED(tokens))
626648
void
627649
SimpleDebugger::cmd_ls(std::vector<std::string>& UNUSED(tokens))
628650
{
651+
assert(obj_);
629652
auto& vars = obj_->getVariables();
630653
for ( auto& x : vars ) {
631654
if ( x.second->isFundamental() ) {

src/sst/core/impl/interactive/simpleDebug.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -265,35 +265,35 @@ class SimpleDebugger : public SST::InteractiveConsole
265265
std::vector<std::string> name_stack;
266266
267267
SST::Core::Serialization::ObjectMap* obj_ = nullptr;
268-
bool done = false;
268+
bool done = false;
269269
int retState = -1; // -1 DONE, -2 SUMAMRY, positive number is threadID
270270
271-
bool autoCompleteEnable = true;
271+
static bool autoCompleteEnable; //skk = true;
272272
273273
// gdb/lldb thread spin support
274274
uint64_t spinner = 1;
275275
276276
// logging support
277-
std::ofstream loggingFile;
278-
std::ifstream replayFile;
279-
std::string loggingFilePath = "sst-console.out";
280-
std::string replayFilePath = "sst-console.in";
281-
bool enLogging = false;
277+
static std::ofstream loggingFile;
278+
static std::ifstream replayFile;
279+
static std::string loggingFilePath; //skk = "sst-console.out";
280+
static std::string replayFilePath; //skk = "sst-console.in";
281+
static bool enLogging; //skk = false;
282282
283283
// command injection (for sst --replay option)
284-
std::stringstream injectedCommand;
284+
static std::stringstream injectedCommand;
285285
286286
// execution state management for nested user commands
287-
ExecState eState = {};
288-
std::stack<ExecState> eStack = {};
287+
static ExecState eState; //skk = {};
288+
static std::stack<ExecState> eStack; //skk = {};
289289
290290
// Keep a pointer to the ObjectMap for the top level Component
291291
SST::Core::Serialization::ObjectMapDeferred<BaseComponent>* base_comp_ = nullptr;
292292
293293
// Keep track of all the WatchPoints
294294
std::vector<std::pair<WatchPoint*, BaseComponent*>> watch_points_;
295295
bool clear_watchlist();
296-
bool confirm = true; // Ask for confirmation to clear watchlist
296+
static bool confirm; //skk = true; // Ask for confirmation to clear watchlist
297297
298298
std::vector<std::string> tokenize(std::vector<std::string>& tokens, const std::string& input);
299299
@@ -353,17 +353,17 @@ class SimpleDebugger : public SST::InteractiveConsole
353353
void dispatch_cmd(std::string& cmd);
354354
355355
// Command Registry
356-
CommandRegistry cmdRegistry;
356+
static CommandRegistry cmdRegistry;
357357
358358
// Command History
359-
CommandHistoryBuffer cmdHistoryBuf;
359+
static CommandHistoryBuffer cmdHistoryBuf;
360360
361361
// Command Line Editor
362-
CmdLineEditor cmdLineEditor;
363-
LINE_ENTRY_MODE line_entry_mode = LINE_ENTRY_MODE::NORMAL;
362+
static CmdLineEditor cmdLineEditor;
363+
static LINE_ENTRY_MODE line_entry_mode; //skk = LINE_ENTRY_MODE::NORMAL;
364364
365365
// Verbosity controlled console printing
366-
uint32_t verbosity = 0;
366+
static uint32_t verbosity; //skk = 0;
367367
void msg(VERBOSITY_MASK mask, std::string message);
368368
};
369369

0 commit comments

Comments
 (0)