MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / dbgRead

Method dbgRead

Source/Lua/CtrlrLuaDebugger.cpp:58–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58std::string CtrlrLuaDebugger::dbgRead(std::string prompt)
59{
60 if (pendingBreakpoints.size() > 0)
61 {
62 for (int i=0; i<pendingBreakpoints.size(); i++)
63 {
64 PendingBreakpoint pb = pendingBreakpoints.removeAndReturn (i);
65
66 if (pendingBreakpoints.size() == 0)
67 {
68 commandQueue.add ("run");
69 }
70
71 if (pb.shouldBeSet)
72 {
73 return (_STR("setb " + _STR(pb.line) + " " + pb.fileName).toStdString());
74 }
75 else
76 {
77 return (_STR("delb " + _STR(pb.line) + " " + pb.fileName).toStdString());
78 }
79 }
80 }
81
82 if (commandQueue.size() > 0)
83 {
84 return (commandQueue.removeAndReturn (commandQueue.size() - 1).toStdString());
85 }
86
87 owner.getOwner().getWindowManager().show (CtrlrPanelWindowManager::LuaMethodEditor);
88
89 CtrlrLuaMethodEditor *ui = dynamic_cast<CtrlrLuaMethodEditor *>(owner.getOwner().getWindowManager().getContent(CtrlrPanelWindowManager::LuaMethodEditor));
90 if (ui)
91 {
92 if (ui->waitForCommand())
93 {
94 commandQueue.add ("trace");
95 commandQueue.add ("vars");
96 commandQueue.add (ui->getCurrentDebuggerCommand (true).toStdString());
97 return (commandQueue.removeAndReturn (commandQueue.size() - 1).toStdString());
98 }
99 else
100 {
101 _WRN("CtrlrLuaDebugger::dbgRead debugger UI didn't return any commands, continuing");
102 return ("run");
103 }
104 }
105
106 _WRN("CtrlrLuaDebugger::dbgRead debugger window is invalid, continuing");
107 return ("run");
108}
109
110std::string CtrlrLuaDebugger::dbgRead()
111{

Callers

nothing calls this directly

Calls 9

toStdStringMethod · 0.80
waitForCommandMethod · 0.80
sizeMethod · 0.45
removeAndReturnMethod · 0.45
addMethod · 0.45
showMethod · 0.45
getOwnerMethod · 0.45
getContentMethod · 0.45

Tested by

no test coverage detected