本文整理汇总了C++中IDebugger::SetEnvironment方法的典型用法代码示例。如果您正苦于以下问题:C++ IDebugger::SetEnvironment方法的具体用法?C++ IDebugger::SetEnvironment怎么用?C++ IDebugger::SetEnvironment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDebugger
的用法示例。
在下文中一共展示了IDebugger::SetEnvironment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadDebuggers
bool DebuggerMgr::LoadDebuggers(const wxString& strDebuggersDir)
{
wxString ext;
#if defined (__WXMSW__)
ext = wxT("dll");
#else
ext = wxT("so");
#endif
wxString fileSpec(wxT("*.")+ext);
//get list of dlls
wxArrayString files;
wxString debuggersPath(strDebuggersDir, wxConvUTF8);
debuggersPath += wxT("/debuggers");
wxDir::GetAllFiles(debuggersPath, &files, fileSpec, wxDIR_FILES);
for(size_t i=0; i<files.GetCount(); i++){
clDynamicLibrary *dl = new clDynamicLibrary();
wxString fileName(files.Item(i));
if(!dl->Load(fileName)){
wxLogMessage(wxT("Failed to load debugger's dll: ") + fileName);
if (!dl->GetError().IsEmpty())
wxLogMessage(dl->GetError());
delete dl;
continue;
}
bool success(false);
GET_DBG_INFO_FUNC pfn = (GET_DBG_INFO_FUNC)dl->GetSymbol(wxT("GetDebuggerInfo"), &success);
if(!success){
wxLogMessage(wxT("Failed to find GetDebuggerInfo() in dll: ") + fileName);
if (!dl->GetError().IsEmpty())
wxLogMessage(dl->GetError());
//dl->Unload();
delete dl;
continue;
}
DebuggerInfo info = pfn();
//Call the init method to create an instance of the debugger
success = false;
GET_DBG_CREATE_FUNC pfnInitDbg = (GET_DBG_CREATE_FUNC)dl->GetSymbol(info.initFuncName, &success);
if(!success){
wxLogMessage(wxT("Failed to find init function in dll: ") + fileName);
if (!dl->GetError().IsEmpty())
wxLogMessage(dl->GetError());
dl->Detach();
delete dl;
continue;
}
wxLogMessage(wxT("Loaded debugger: ") + info.name + wxT(", Version: ") + info.version);
IDebugger *dbg = pfnInitDbg();
//set the environment
dbg->SetEnvironment(m_env);
m_debuggers[info.name] = dbg;
//keep the dynamic load library
m_dl.push_back(dl);
}
return true;
}
示例2: LoadDebuggers
bool DebuggerMgr::LoadDebuggers()
{
wxString ext;
#if defined(__WXMSW__)
ext = wxT("dll");
#elif defined(__WXMAC__)
ext = wxT("dylib");
#else
ext = wxT("so");
#endif
wxString fileSpec(wxT("*.") + ext);
// get list of dlls
wxArrayString files;
#ifdef __WXGTK__
wxString debuggersPath(PLUGINS_DIR, wxConvUTF8);
debuggersPath += wxT("/debuggers");
#elif defined(__WXMSW__)
#ifdef USE_POSIX_LAYOUT
wxString debuggersPath(clStandardPaths::Get().GetPluginsDirectory() + wxT("/debuggers"));
#else
wxString debuggersPath(m_baseDir + wxT("/debuggers"));
#endif
#else
// OSX
wxFileName debuggersFolder(clStandardPaths::Get().GetDataDir(), "");
debuggersFolder.AppendDir("debuggers");
wxString debuggersPath(debuggersFolder.GetPath());
#endif
CL_DEBUG("Loading debuggers from: %s", debuggersPath);
wxDir::GetAllFiles(debuggersPath, &files, fileSpec, wxDIR_FILES);
for(size_t i = 0; i < files.GetCount(); i++) {
clDynamicLibrary* dl = new clDynamicLibrary();
wxString fileName(files.Item(i));
CL_DEBUG("Attempting to load debugger: %s", fileName);
#if defined(__WXMSW__) && !defined(NDEBUG)
// Under MSW loading a release plugin while in debug mode will cause a crash
if(!fileName.EndsWith("-dbg.dll")) {
continue;
}
#elif defined(__WXMSW__)
// filter debug plugins
if(fileName.EndsWith("-dbg.dll")) {
continue;
}
#endif
if(!dl->Load(fileName)) {
CL_WARNING("Failed to load debugger: %s", fileName);
if(!dl->GetError().IsEmpty()) {
CL_WARNING("%s", dl->GetError());
}
delete dl;
continue;
}
bool success(false);
GET_DBG_INFO_FUNC pfn = (GET_DBG_INFO_FUNC)dl->GetSymbol(wxT("GetDebuggerInfo"), &success);
if(!success) {
wxLogMessage(wxT("Failed to find GetDebuggerInfo() in dll: ") + fileName);
if(!dl->GetError().IsEmpty()) {
wxLogMessage(dl->GetError());
}
// dl->Unload();
delete dl;
continue;
}
DebuggerInfo info = pfn();
// Call the init method to create an instance of the debugger
success = false;
GET_DBG_CREATE_FUNC pfnInitDbg = (GET_DBG_CREATE_FUNC)dl->GetSymbol(info.initFuncName, &success);
if(!success) {
wxLogMessage(wxT("Failed to find init function in dll: ") + fileName);
if(!dl->GetError().IsEmpty()) {
wxLogMessage(dl->GetError());
}
dl->Detach();
delete dl;
continue;
}
wxLogMessage(wxT("Loaded debugger: ") + info.name + wxT(", Version: ") + info.version);
IDebugger* dbg = pfnInitDbg();
// set the environment
dbg->SetEnvironment(m_env);
m_debuggers[info.name] = dbg;
// keep the dynamic load library
m_dl.push_back(dl);
}
//.........这里部分代码省略.........