diff --git a/core/adapters/dbgengadapter.cpp b/core/adapters/dbgengadapter.cpp index d5fd7dda..7cb0676f 100644 --- a/core/adapters/dbgengadapter.cpp +++ b/core/adapters/dbgengadapter.cpp @@ -331,6 +331,7 @@ bool DbgEngAdapter::ConnectToDebugServerInternal(const std::string& connectionSt QUERY_DEBUG_INTERFACE(IDebugControl7, &this->m_debugControl); QUERY_DEBUG_INTERFACE(IDebugDataSpaces, &this->m_debugDataSpaces); QUERY_DEBUG_INTERFACE(IDebugDataSpaces2, &this->m_debugDataSpaces2); + QUERY_DEBUG_INTERFACE(IDebugDataSpaces4, &this->m_debugDataSpaces4); QUERY_DEBUG_INTERFACE(IDebugRegisters, &this->m_debugRegisters); QUERY_DEBUG_INTERFACE(IDebugSymbols3, &this->m_debugSymbols); QUERY_DEBUG_INTERFACE(IDebugSystemObjects, &this->m_debugSystemObjects); @@ -424,6 +425,7 @@ void DbgEngAdapter::Reset() SAFE_RELEASE(this->m_debugControl); SAFE_RELEASE(this->m_debugDataSpaces); SAFE_RELEASE(this->m_debugDataSpaces2); + SAFE_RELEASE(this->m_debugDataSpaces4); SAFE_RELEASE(this->m_debugRegisters); SAFE_RELEASE(this->m_debugSymbols); SAFE_RELEASE(this->m_debugSystemObjects); diff --git a/core/adapters/dbgengadapter.h b/core/adapters/dbgengadapter.h index 7f007033..7dfc01d1 100644 --- a/core/adapters/dbgengadapter.h +++ b/core/adapters/dbgengadapter.h @@ -129,6 +129,7 @@ namespace BinaryNinjaDebugger { IDebugControl7* m_debugControl {nullptr}; IDebugDataSpaces* m_debugDataSpaces {nullptr}; IDebugDataSpaces2* m_debugDataSpaces2 {nullptr}; + IDebugDataSpaces4* m_debugDataSpaces4 {nullptr}; IDebugRegisters* m_debugRegisters {nullptr}; IDebugSymbols3* m_debugSymbols {nullptr}; IDebugSystemObjects* m_debugSystemObjects {nullptr}; diff --git a/core/adapters/dbgengttdadapter.cpp b/core/adapters/dbgengttdadapter.cpp index f68e1690..aee47d53 100644 --- a/core/adapters/dbgengttdadapter.cpp +++ b/core/adapters/dbgengttdadapter.cpp @@ -133,6 +133,11 @@ bool DbgEngTTDAdapter::Start() QUERY_DEBUG_INTERFACE(IDebugControl7, &this->m_debugControl); QUERY_DEBUG_INTERFACE(IDebugDataSpaces, &this->m_debugDataSpaces); + // The TTD adapter opens a trace directly instead of going through + // DbgEngAdapter::ConnectToDebugServerInternal(), so these have to be queried here too, otherwise + // they stay null and everything built on them (e.g. GetMemoryMap()) silently does nothing. + QUERY_DEBUG_INTERFACE(IDebugDataSpaces2, &this->m_debugDataSpaces2); + QUERY_DEBUG_INTERFACE(IDebugDataSpaces4, &this->m_debugDataSpaces4); QUERY_DEBUG_INTERFACE(IDebugRegisters, &this->m_debugRegisters); QUERY_DEBUG_INTERFACE(IDebugSymbols3, &this->m_debugSymbols); QUERY_DEBUG_INTERFACE(IDebugSystemObjects, &this->m_debugSystemObjects); @@ -185,6 +190,8 @@ void DbgEngTTDAdapter::Reset() // we should keep everything active. SAFE_RELEASE(this->m_debugControl); SAFE_RELEASE(this->m_debugDataSpaces); + SAFE_RELEASE(this->m_debugDataSpaces2); + SAFE_RELEASE(this->m_debugDataSpaces4); SAFE_RELEASE(this->m_debugRegisters); SAFE_RELEASE(this->m_debugSymbols); SAFE_RELEASE(this->m_dataModelManager);