@@ -50,8 +50,8 @@ SimpleDebugger::SimpleDebugger(Params& params) :
5050 [this ](std::vector<std::string>& tokens) { cmd_help (tokens); } },
5151 { " verbose" , " v" , " [mask]: set verbosity mask or print if no mask specified" , ConsoleCommandGroup::GENERAL,
5252 [this ](std::vector<std::string>& tokens) { cmd_verbose (tokens); } },
53- { " info" , " info" , " \" current\" |\" all\" print summary for current thread or all threads" , ConsoleCommandGroup::GENERAL,
54- [this ](std::vector<std::string>& tokens) { cmd_info (tokens); } },
53+ { " info" , " info" , " \" current\" |\" all\" print summary for current thread or all threads" ,
54+ ConsoleCommandGroup::GENERAL, [this ](std::vector<std::string>& tokens) { cmd_info (tokens); } },
5555 { " thread" , " thd" , " [threadID]: switch to specified thread ID" , ConsoleCommandGroup::GENERAL,
5656 [this ](std::vector<std::string>& tokens) { cmd_thread (tokens); } },
5757 { " confirm" , " cfm" , " <true/false>: set confirmation requests on (default) or off" , ConsoleCommandGroup::GENERAL,
@@ -141,9 +141,9 @@ SimpleDebugger::SimpleDebugger(Params& params) :
141141 " \t 'watch' creates a default watchpoint that breaks into an interactive console when triggered\n "
142142 " \t 'trace' creates a watchpoint with a trace buffer to trace a set of variables and trigger an <action>\n "
143143 " \t Available actions include: \n "
144- " \t interactive, printTrace, checkpoint, set <var> <val>, printStatus, or shutdown"
145- " \t Note: checkpoint action must be enabled at startup via the '--checkpoint-enable' command line option \n "
146- },
144+ " \t interactive, printTrace, checkpoint, set <var> <val>, printStatus, or shutdown"
145+ " \t Note: checkpoint action must be enabled at startup via the '--checkpoint-enable' command line "
146+ " option \n " },
147147 { " watch" , " <trigger>: adds watchpoint to the watchlist; breaks into interactive console when triggered\n "
148148 " \t Example: watch var1 > 90 && var2 < 100 || var3 changed" },
149149 { " trace" ,
@@ -230,7 +230,7 @@ SimpleDebugger::summary()
230230 << ")\n";
231231 std::cout << " -- Trigger Status\n";
232232#endif
233-
233+
234234 std::cout << " -- Component Summary\n " ;
235235#if 0
236236 std::vector<std::string> tokens;
@@ -240,9 +240,9 @@ SimpleDebugger::summary()
240240 cmd_ls(tokens);
241241#else
242242 SST::Core::Serialization::ObjectMap* baseObj = getComponentObjectMap ();
243- auto & vars = baseObj->getVariables ();
244- for (auto & x : vars) {
245- if (x.second ->isFundamental ()) {
243+ auto & vars = baseObj->getVariables ();
244+ for ( auto & x : vars ) {
245+ if ( x.second ->isFundamental () ) {
246246 std::cout << x.first << " = " << x.second ->get () << " (" << x.second ->getType () << " )" << std::endl;
247247 }
248248 else {
@@ -255,17 +255,18 @@ SimpleDebugger::summary()
255255int
256256SimpleDebugger::execute (const std::string& msg)
257257{
258- RankInfo info = getRank ();
258+ RankInfo info = getRank ();
259259 RankInfo nRanks = getNumRanks ();
260- printf (" \n ---- Rank%d:Thread%d: Entering interactive mode at time %" PRI_SIMTIME " \n " , info.rank , info.thread , getCurrentSimCycle ());
260+ printf (" \n ---- Rank%d:Thread%d: Entering interactive mode at time %" PRI_SIMTIME " \n " , info.rank , info.thread ,
261+ getCurrentSimCycle ());
261262 printf (" %s\n " , msg.c_str ());
262263
263264 if ( nullptr == obj_ ) {
264265 obj_ = getComponentObjectMap ();
265266 }
266- done = false ;
267+ done = false ;
267268 retState = -1 ;
268-
269+
269270
270271 // Select the input source and next command line
271272 std::string line;
@@ -536,28 +537,29 @@ SimpleDebugger::cmd_verbose(std::vector<std::string>& tokens)
536537}
537538
538539void
539- SimpleDebugger::cmd_info (std::vector<std::string>& UNUSED (tokens)) {
540+ SimpleDebugger::cmd_info (std::vector<std::string>& UNUSED (tokens))
541+ {
540542
541- if (tokens.size () != 2 ) {
543+ if ( tokens.size () != 2 ) {
542544 printf (" Invalid format for info command (info \" current\" |\" all\" )\n " );
543545 return ;
544546 }
545547
546- RankInfo info = getRank ();
548+ RankInfo info = getRank ();
547549 RankInfo nRanks = getNumRanks ();
548- if (tokens[1 ] == " current" ) {
549- std::cout << " Rank " << info.rank << " /" << nRanks.rank
550- << " , Thread " << info. thread << " / " << nRanks. thread << std::endl;
550+ if ( tokens[1 ] == " current" ) {
551+ std::cout << " Rank " << info.rank << " /" << nRanks.rank << " , Thread " << info. thread << " / " << nRanks. thread
552+ << std::endl;
551553 }
552- else if (tokens[1 ] == " all" ) {
553- if (nRanks.rank == 1 && nRanks.thread == 1 ) {
554- std::cout << " Rank " << info.rank << " /" << nRanks.rank
555- << " , Thread " << info. thread << " / " << nRanks.thread << std::endl;
554+ else if ( tokens[1 ] == " all" ) {
555+ if ( nRanks.rank == 1 && nRanks.thread == 1 ) {
556+ std::cout << " Rank " << info.rank << " /" << nRanks.rank << " , Thread " << info. thread << " / "
557+ << nRanks.thread << std::endl;
556558 }
557559 else {
558560 // Return to syncmanager to print summary for all threads
559561 retState = -2 ; // summary info
560- done = true ;
562+ done = true ;
561563 }
562564 }
563565 else {
@@ -568,40 +570,41 @@ SimpleDebugger::cmd_info(std::vector<std::string>& UNUSED(tokens)) {
568570
569571// thread <threadID> : switches to new thread
570572void
571- SimpleDebugger::cmd_thread (std::vector<std::string>& tokens) {
573+ SimpleDebugger::cmd_thread (std::vector<std::string>& tokens)
574+ {
572575
573- if (tokens.size () != 2 ) {
576+ if ( tokens.size () != 2 ) {
574577 printf (" Invalid format for thread command (thread <threadID>)\n " );
575578 return ;
576579 }
577580
578- RankInfo info = getRank ();
581+ RankInfo info = getRank ();
579582 RankInfo nRanks = getNumRanks ();
580- int threadID;
583+ int threadID;
581584
582585 // Get threadID
583586 try {
584587 threadID = std::stoi (tokens[1 ]);
585588 }
586- catch (const std::invalid_argument& e) {
589+ catch ( const std::invalid_argument& e ) {
587590 std::cout << " Invalid argument for threadID: " << tokens[1 ] << std::endl;
588591 return ;
589592 }
590- catch (const std::out_of_range& e) {
593+ catch ( const std::out_of_range& e ) {
591594 std::cout << " Out of range for threadID: " << tokens[1 ] << std::endl;
592595 return ;
593596 }
594597
595598 // Check if valid threadID
596- if (threadID < 0 || threadID >= nRanks.thread ) {
597- printf (" ThreadID %d out of range (0:%d)\n " , threadID, nRanks.thread - 1 );
599+ if ( threadID < 0 || threadID >= nRanks.thread ) {
600+ printf (" ThreadID %d out of range (0:%d)\n " , threadID, nRanks.thread - 1 );
598601 return ;
599602 }
600-
603+
601604 // If not current thread, set retState and done flag
602- if (threadID != info.thread ) {
605+ if ( threadID != info.thread ) {
603606 retState = threadID;
604- done = true ;
607+ done = true ;
605608 }
606609 return ;
607610}
@@ -665,7 +668,7 @@ SimpleDebugger::cmd_cd(std::vector<std::string>& tokens)
665668 }
666669#else
667670 // skk This works but doesn't delete/deactivate like objmap selectParent
668- if (tokens.size() == 1) {
671+ if ( tokens.size() == 1 ) {
669672 obj_ = getComponentObjectMap();
670673 return;
671674 }
@@ -923,20 +926,19 @@ SimpleDebugger::cmd_run(std::vector<std::string>& tokens)
923926 return ;
924927 }
925928 }
926- else if (tokens.size () == 3 ) {
929+ else if ( tokens.size () == 3 ) {
927930 std::string time = tokens[1 ] + tokens[2 ];
928931 try {
929- TimeConverter* tc = getTimeConverter (time);
932+ TimeConverter* tc = getTimeConverter (time);
930933 std::string msg = format_string (" Running clock %" PRI_SIMTIME " sim cycles" , tc->getFactor ());
931934 schedule_interactive (tc->getFactor (), msg);
932935 }
933- catch (std::exception& e) {
936+ catch ( std::exception& e ) {
934937 printf (" Unknown time in call to run: %s\n " , time.c_str ());
935938 return ;
936939 }
937-
938940 }
939- else if (tokens.size () != 1 ) {
941+ else if ( tokens.size () != 1 ) {
940942 printf (" Too many arguments for 'run <time>'\n " );
941943 }
942944
0 commit comments