NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
DebugViewer Class Reference

#include <debugviewer.hpp>

Inheritance diagram for DebugViewer:
Collaboration diagram for DebugViewer:

Public Member Functions

 DebugViewer (wxWindow *parent, Options *_options, const wxString &title="NumeRe: Debugger")
 Constructor. Creates the necessary controls of the debugger window. More...
 
void updateSettings ()
 This member function should be called after the user modified the application settings. It will propagate the necessary application settings into the debugger. More...
 
void setTerminal (NumeReTerminal *term)
 
void setDebugInfo (const wxString &title, const std::vector< std::string > &vStack)
 This member function is used from the main window to update the debugger window with the information of the current debug event (aka the new stack). More...
 
void OnClose (wxCloseEvent &event)
 This member function is called upon closing the debugger window: it won't be destroyed but hidden and the kernel will get a CONTINUE signal. More...
 
void OnExecutionFinished ()
 This member function will inform the debugger window that the execution of the current code has ben finished. More...
 
 DECLARE_EVENT_TABLE ()
 
- Public Member Functions inherited from ViewerFrame
 ViewerFrame (wxWindow *parent, const wxString &title)
 
void OnKeyDown (wxKeyEvent &event)
 This event handler closes the frame, if the user presses ESC. More...
 
void OnFocus (wxFocusEvent &event)
 This event handler passes the keyboard focus down to the first child in the window list, if the frame gets keyboard focus. More...
 
void OnEnter (wxMouseEvent &event)
 This event handler get the keyboard focus, if the user enters with the mouse. More...
 
void OnClose (wxCloseEvent &event)
 This event handler informs all child windows that this frame will now close. It furthermore automatically unregisters itself in the opened window list. More...
 
 DECLARE_EVENT_TABLE ()
 

Private Member Functions

void initializeToolbar ()
 This private member function creates the toolbar of the debugger window. More...
 
void setExpression (const std::string &sLineNumber, const std::string &sExpression)
 This private member function updates the expression element in the debugger window and changes the colour of the characters correspondingly. More...
 
void getInformationByStackId (size_t id)
 This private member function gets the debugger information from the selected stack ID. More...
 
void OnStackItemActivate (wxListEvent &event)
 This member function is the event handler function for double-clicking on a stack item. More...
 
void OnMenuEvent (wxCommandEvent &event)
 This member function is the event handler routine for the toolbar functions. More...
 
void EnableDebugger (bool enable)
 This member function may enable or disable the debugger toolbar. More...
 

Private Attributes

VariableViewerm_varViewer
 
wxTextCtrl * m_expression
 
wxTextCtrl * m_lineNumber
 
wxTextCtrl * m_errorMessage
 
wxListCtrl * m_stacktrace
 
NumeReTerminalm_terminal
 
Optionsm_options
 
bool b_transferredControl
 
int nLineColumn
 
int nModuleColumn
 

Detailed Description

Definition at line 32 of file debugviewer.hpp.

Constructor & Destructor Documentation

◆ DebugViewer()

DebugViewer::DebugViewer ( wxWindow *  parent,
Options _options,
const wxString &  title = "NumeRe: Debugger" 
)

Constructor. Creates the necessary controls of the debugger window.

Parameters
parentwxWindow*
_optionsOptions*
titleconst wxString&

Definition at line 48 of file debugviewer.cpp.

References _guilang, and Language::get().

Here is the call graph for this function:

Member Function Documentation

◆ DECLARE_EVENT_TABLE()

DebugViewer::DECLARE_EVENT_TABLE ( )

◆ EnableDebugger()

void DebugViewer::EnableDebugger ( bool  enable)
private

This member function may enable or disable the debugger toolbar.

Parameters
enablebool
Returns
void

Definition at line 397 of file debugviewer.cpp.

References ID_DEBUG_CANCEL, ID_DEBUG_CONTINUE, ID_DEBUG_LEAVE, ID_DEBUG_STEP, and ID_DEBUG_STEPOVER.

Referenced by OnExecutionFinished(), OnMenuEvent(), and setDebugInfo().

◆ getInformationByStackId()

void DebugViewer::getInformationByStackId ( size_t  id)
private

This private member function gets the debugger information from the selected stack ID.

Parameters
idsize_t
Returns
void

Definition at line 245 of file debugviewer.cpp.

References NumeReTerminal::_kernel, NumeReDebugger::getArguments(), NumeReDebugger::getClusters(), NumeReKernel::getDebugger(), NumeReDebugger::getGlobals(), NumeReDebugger::getModuleInformations(), NumeReDebugger::getNumVars(), Options::GetShowGlobalVariables(), Options::GetShowProcedureArguments(), NumeReDebugger::getStringVars(), NumeReDebugger::getTables(), m_errorMessage, NumeReTerminal::m_kernelCS, m_options, m_stacktrace, m_terminal, m_varViewer, NumeReDebugger::select(), setExpression(), and VariableViewer::UpdateVariables().

Referenced by OnStackItemActivate(), and setDebugInfo().

Here is the call graph for this function:

◆ initializeToolbar()

void DebugViewer::initializeToolbar ( )
private

This private member function creates the toolbar of the debugger window.

Returns
void

Definition at line 143 of file debugviewer.cpp.

References _guilang, Language::get(), ID_DEBUG_CANCEL, ID_DEBUG_CONTINUE, ID_DEBUG_LEAVE, ID_DEBUG_STEP, and ID_DEBUG_STEPOVER.

Here is the call graph for this function:

◆ OnClose()

void DebugViewer::OnClose ( wxCloseEvent &  event)

This member function is called upon closing the debugger window: it won't be destroyed but hidden and the kernel will get a CONTINUE signal.

Parameters
eventwxCloseEvent&
Returns
void

Definition at line 511 of file debugviewer.cpp.

References b_transferredControl, NumeReTerminal::continueDebug(), and m_terminal.

Here is the call graph for this function:

◆ OnExecutionFinished()

void DebugViewer::OnExecutionFinished ( )

This member function will inform the debugger window that the execution of the current code has ben finished.

Returns
void

The debugger window will disable its toolbar and display a corresponding message in the status bar.

Definition at line 532 of file debugviewer.cpp.

References _guilang, EnableDebugger(), Language::get(), and m_errorMessage.

Referenced by NumeReWindow::Ready().

Here is the call graph for this function:

◆ OnMenuEvent()

void DebugViewer::OnMenuEvent ( wxCommandEvent &  event)
private

This member function is the event handler routine for the toolbar functions.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 333 of file debugviewer.cpp.

References _guilang, b_transferredControl, NumeReTerminal::CancelCalculation(), NumeReTerminal::continueDebug(), EnableDebugger(), Language::get(), ID_DEBUG_CANCEL, ID_DEBUG_CONTINUE, ID_DEBUG_LEAVE, ID_DEBUG_STEP, ID_DEBUG_STEPOVER, NumeReTerminal::leaveDebug(), m_terminal, NumeReTerminal::stepDebug(), and NumeReTerminal::stepOverDebug().

Here is the call graph for this function:

◆ OnStackItemActivate()

void DebugViewer::OnStackItemActivate ( wxListEvent &  event)
private

This member function is the event handler function for double-clicking on a stack item.

Parameters
eventwxListEvent&
Returns
void

Definition at line 230 of file debugviewer.cpp.

References getInformationByStackId(), and m_stacktrace.

Here is the call graph for this function:

◆ setDebugInfo()

void DebugViewer::setDebugInfo ( const wxString &  title,
const std::vector< std::string > &  vStack 
)

This member function is used from the main window to update the debugger window with the information of the current debug event (aka the new stack).

Parameters
titleconst wxString&
vStackconst std::vector<std::string>&
Returns
void

Definition at line 448 of file debugviewer.cpp.

References _guilang, SettingsValue::active(), b_transferredControl, EnableDebugger(), Language::get(), getInformationByStackId(), Settings::getSetting(), Options::GetShowLinesInStackTrace(), Options::GetShowModulesInStackTrace(), m_errorMessage, m_options, m_stacktrace, nLineColumn, nModuleColumn, and SETTING_B_FLASHTASKBAR.

Referenced by NumeReWindow::evaluateDebugInfo().

Here is the call graph for this function:

◆ setExpression()

void DebugViewer::setExpression ( const std::string &  sLineNumber,
const std::string &  sExpression 
)
private

This private member function updates the expression element in the debugger window and changes the colour of the characters correspondingly.

Parameters
sLineNumberconst std::string&
sExpressionconst std::string&
Returns
void

Definition at line 184 of file debugviewer.cpp.

References Options::COMMAND, SyntaxStyles::foreground, Options::FUNCTION, GenericTerminal::getSyntax(), Options::GetSyntaxStyle(), NumeReSyntax::highlightLine(), m_expression, m_lineNumber, m_options, m_terminal, Options::METHODS, Options::OPERATOR, Options::PROCEDURE, Options::STRING, NumeReSyntax::SYNTAX_COMMAND, NumeReSyntax::SYNTAX_FUNCTION, NumeReSyntax::SYNTAX_METHODS, NumeReSyntax::SYNTAX_NPRC_COMMAND, NumeReSyntax::SYNTAX_OPERATOR, NumeReSyntax::SYNTAX_PROCEDURE, and NumeReSyntax::SYNTAX_STRING.

Referenced by getInformationByStackId().

Here is the call graph for this function:

◆ setTerminal()

void DebugViewer::setTerminal ( NumeReTerminal term)
inline

Definition at line 60 of file debugviewer.hpp.

References m_terminal.

Referenced by NumeReWindow::evaluateDebugInfo().

◆ updateSettings()

void DebugViewer::updateSettings ( )

This member function should be called after the user modified the application settings. It will propagate the necessary application settings into the debugger.

Returns
void

Definition at line 418 of file debugviewer.cpp.

References Options::GetShowLinesInStackTrace(), Options::GetShowModulesInStackTrace(), m_options, m_stacktrace, m_varViewer, nLineColumn, nModuleColumn, and VariableViewer::setDebuggerMode().

Referenced by NumeReWindow::EvaluateOptions().

Here is the call graph for this function:

Member Data Documentation

◆ b_transferredControl

bool DebugViewer::b_transferredControl
private

Definition at line 43 of file debugviewer.hpp.

Referenced by OnClose(), OnMenuEvent(), and setDebugInfo().

◆ m_errorMessage

wxTextCtrl* DebugViewer::m_errorMessage
private

Definition at line 38 of file debugviewer.hpp.

Referenced by getInformationByStackId(), OnExecutionFinished(), and setDebugInfo().

◆ m_expression

wxTextCtrl* DebugViewer::m_expression
private

Definition at line 36 of file debugviewer.hpp.

Referenced by setExpression().

◆ m_lineNumber

wxTextCtrl* DebugViewer::m_lineNumber
private

Definition at line 37 of file debugviewer.hpp.

Referenced by setExpression().

◆ m_options

Options* DebugViewer::m_options
private

◆ m_stacktrace

wxListCtrl* DebugViewer::m_stacktrace
private

◆ m_terminal

NumeReTerminal* DebugViewer::m_terminal
private

◆ m_varViewer

VariableViewer* DebugViewer::m_varViewer
private

Definition at line 35 of file debugviewer.hpp.

Referenced by getInformationByStackId(), and updateSettings().

◆ nLineColumn

int DebugViewer::nLineColumn
private

Definition at line 44 of file debugviewer.hpp.

Referenced by setDebugInfo(), and updateSettings().

◆ nModuleColumn

int DebugViewer::nModuleColumn
private

Definition at line 45 of file debugviewer.hpp.

Referenced by setDebugInfo(), and updateSettings().


The documentation for this class was generated from the following files: