SST 15.0
Structural Simulation Toolkit
simpleDebug.h
1// Copyright 2009-2025 NTESS. Under the terms
2// of Contract DE-NA0003525 with NTESS, the U.S.
3// Government retains certain rights in this software.
4//
5// Copyright (c) 2009-2025, NTESS
6// All rights reserved.
7//
8// This file is part of the SST software package. For license
9// information, see the LICENSE file in the top level directory of the
10// distribution.
11
12#ifndef SST_CORE_IMPL_INTERACTIVE_SIMPLEDEBUG_H
13#define SST_CORE_IMPL_INTERACTIVE_SIMPLEDEBUG_H
14
15#include "sst/core/eli/elementinfo.h"
16#include "sst/core/interactiveConsole.h"
17#include "sst/core/serialization/objectMapDeferred.h"
18#include "sst/core/watchPoint.h"
19
20#include <string>
21#include <vector>
22
23namespace SST::IMPL::Interactive {
24
25
26/**
27 Self partitioner actually does nothing. It is simply a pass
28 through for graphs which have been partitioned during graph
29 creation.
30*/
32{
33
34public:
37 "sst",
38 "interactive.simpledebug",
39 SST_ELI_ELEMENT_VERSION(1, 0, 0),
40 "{EXPERIMENTAL} Basic interactive debugging console for interactive mode."
41 )
42
43 /**
44 Creates a new self partition scheme.
45 */
46 explicit SimpleDebugger(Params& params);
47
48 void execute(const std::string& msg) override;
49
50private:
51 // This is the stack of where we are in the class hierarchy. This
52 // is needed because when we advance time, we'll need to delete
53 // any ObjectMap because they could change during execution.
54 // After running, this will allow us to recreate the working
55 // directory as far as we can.
56 std::vector<std::string> name_stack;
57
58 SST::Core::Serialization::ObjectMap* obj_ = nullptr;
59 bool done = false;
60
61 // Keep a pointer to the ObjectMap for the top level Component
62 SST::Core::Serialization::ObjectMapDeferred<BaseComponent>* base_comp_ = nullptr;
63
64 // Keep track of all the WatchPoints
65 std::vector<std::pair<WatchPoint*, BaseComponent*>> watch_points_;
66
67 std::vector<std::string> tokenize(std::vector<std::string>& tokens, const std::string& input);
68
69 void cmd_pwd(std::vector<std::string>& tokens);
70 void cmd_ls(std::vector<std::string>& tokens);
71 void cmd_cd(std::vector<std::string>& tokens);
72 void cmd_print(std::vector<std::string>& tokens);
73 void cmd_set(std::vector<std::string>& tokens);
74 void cmd_time(std::vector<std::string>& tokens);
75 void cmd_run(std::vector<std::string>& tokens);
76 void cmd_watch(std::vector<std::string>& tokens);
77 void cmd_unwatch(std::vector<std::string>& tokens);
78
79 void dispatch_cmd(std::string cmd);
80};
81
82} // namespace SST::IMPL::Interactive
83
84#endif
Main component object for the simulation.
Definition baseComponent.h:62
ObjectMap version that will delay building the internal data structures until the object is "selected...
Definition objectMapDeferred.h:29
Base class for objects created by the serializer mapping mode used to map the variables for objects.
Definition objectMap.h:112
Self partitioner actually does nothing.
Definition simpleDebug.h:32
void execute(const std::string &msg) override
Called by TimeVortex to trigger checkpoint on simulation clock interval - not used in parallel simula...
Definition simpleDebug.cc:27
SST_ELI_REGISTER_INTERACTIVE_CONSOLE(SimpleDebugger, "sst", "interactive.simpledebug", SST_ELI_ELEMENT_VERSION(1, 0, 0), "{EXPERIMENTAL} Basic interactive debugging console for interactive mode.") explicit SimpleDebugger(Params &params)
Creates a new self partition scheme.
Definition interactiveConsole.h:46
Parameter store.
Definition params.h:58
Class that can attach to Clock and Event Handlers to monitor the state of variables.
Definition watchPoint.h:27