1 /*************************************************************** 2 * Name: Valgrind.h 3 * Purpose: Code::Blocks Valgrind plugin: main functions 4 * Author: Lieven de Cock (aka killerbot) 5 * Created: 28/07/2007 6 * Copyright: (c) Lieven de Cock (aka killerbot) 7 * License: GPL 8 **************************************************************/ 9 10 #ifndef VALGRIND_H_INCLUDED 11 #define VALGRIND_H_INCLUDED 12 13 #include "cbplugin.h" // the base class we 're inheriting 14 15 class TextCtrlLogger; 16 class ValgrindListLog; 17 class TiXmlDocument; 18 class TiXmlElement; 19 20 class Valgrind : public cbPlugin 21 { 22 public: 23 Valgrind(); 24 ~Valgrind(); 25 void BuildMenu(wxMenuBar* menuBar); 26 void BuildModuleMenu(const ModuleType /*type*/, wxMenu* /*menu*/, const FileTreeData* /*data*/ = 0){}; BuildToolBar(wxToolBar *)27 bool BuildToolBar(wxToolBar* /*toolBar*/){ return false; } 28 void OnAttach(); // fires when the plugin is attached to the application 29 void OnRelease(bool appShutDown); // fires when the plugin is released from the application 30 GetConfigurationPriority()31 int GetConfigurationPriority() const { return 50; } GetConfigurationGroup()32 int GetConfigurationGroup() const { return cgCompiler; } 33 cbConfigurationPanel* GetConfigurationPanel(wxWindow* parent); 34 private: 35 void WriteToLog(const wxString& Text); 36 void AppendToLog(const wxString& Text); 37 void ProcessStack(const TiXmlElement& Stack, bool AddHeader); 38 long DoValgrindVersion(); 39 void ParseMemCheckXML(TiXmlDocument &Doc); 40 wxString BuildMemCheckCmd(); 41 wxString BuildCacheGrindCmd(); 42 wxString GetValgrindExecutablePath(); 43 44 void OnMemCheckRun(wxCommandEvent& event); 45 void OnMemCheckOpenLog(wxCommandEvent& event); 46 void OnCachegrind(wxCommandEvent& event); 47 48 private: 49 TextCtrlLogger* m_ValgrindLog; //!< log tab in the message pane 50 ValgrindListLog* m_ListLog; //!< log tab to click/double click to take you to offending line of code 51 int m_LogPageIndex; //!< index of our log tab (can this change during run time ??) 52 int m_ListLogPageIndex; //!< index of our list log tab 53 54 private: 55 DECLARE_EVENT_TABLE() 56 }; 57 58 #endif // VALGRIND_H_INCLUDED 59