Skip to content

Commit

Permalink
Fixes uninitialized object segfault in debugger (#1162)
Browse files Browse the repository at this point in the history
* Fixes uninitialized object segfault in debugger
Minor typo fixes

* Fix error check in debugger print cmd
  • Loading branch information
gvoskuilen authored Oct 11, 2024
1 parent d622a26 commit 430b9a6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/sst/core/impl/interactive/simpleDebug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ SimpleDebugger::cmd_print(std::vector<std::string>& tokens)
// Index in tokens array where we may find the variable name
size_t var_index = 1;

if ( tokens.size() < 2 ) {
printf("Invalid format for print command (print [-rN] [<obj>])\n");
return;
}

// See if have a -r or not
int recurse = 0;
std::string tok = tokens[1];
Expand Down
2 changes: 1 addition & 1 deletion src/sst/core/impl/interactive/simpleDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SimpleDebugger : public SST::InteractiveConsole
// directory as far as we can.
std::vector<std::string> name_stack;

SST::Core::Serialization::ObjectMap* obj_;
SST::Core::Serialization::ObjectMap* obj_ = nullptr;
bool done = false;

std::vector<std::string> tokenize(std::vector<std::string>& tokens, const std::string& input);
Expand Down
2 changes: 1 addition & 1 deletion src/sst/core/serialization/objectMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class ObjectMap
/**
Get the list of child variables contained in this ObjectMap
@return Refernce to vector containing ObjectMaps for this
@return Reference to vector containing ObjectMaps for this
ObjectMap's child variables. Fundamental types will return the
same empty vector.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/sst/core/simulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ Simulation_impl::run()
}

InteractiveAction* act =
new InteractiveAction(this, format_string("Interctive start at %" PRI_SIMTIME, offset));
new InteractiveAction(this, format_string("Interactive start at %" PRI_SIMTIME, offset));
act->setDeliveryTime(currentSimCycle + offset);
timeVortex->insert(act);
}
Expand Down

0 comments on commit 430b9a6

Please sign in to comment.