diff --git a/pykd/dbgengine.h b/pykd/dbgengine.h index d434bea..37accb8 100644 --- a/pykd/dbgengine.h +++ b/pykd/dbgengine.h @@ -17,6 +17,13 @@ bool isKernelDebugging(); void debugGo(); +// debug output +void dprint( const std::wstring &str, bool dml = false ); +void dprintln( const std::wstring &str, bool dml = false ); +std::string dreadline(); +void eprint( const std::wstring &str ); +void eprintln( const std::wstring &str ); + // system properties ULONG ptrSize(); bool is64bitSystem(); @@ -48,5 +55,6 @@ struct STACK_FRAME_DESC { ULONG getStackTraceFrameCount(); void getStackTrace( STACK_FRAME_DESC* frames, ULONG frameCount, ULONG* frameReturned = NULL ); + }; diff --git a/pykd/dbgext.cpp b/pykd/dbgext.cpp index 35b3bd3..8d48925 100644 --- a/pykd/dbgext.cpp +++ b/pykd/dbgext.cpp @@ -3,13 +3,50 @@ #include -//#include -// -//#include "windbg.h" -//#include "dbgclient.h" -//#include "dbgpath.h" +#include "win/dbgio.h" +#include "win/dbgeng.h" +#include "win/dbgpath.h" +#include "win/windbg.h" -//using namespace pykd; +using namespace pykd; + +//////////////////////////////////////////////////////////////////////////////// + +extern "C" void initpykd(); + +//////////////////////////////////////////////////////////////////////////////// + +WindbgGlobalSession::WindbgGlobalSession() +{ + PyImport_AppendInittab("pykd", initpykd ); + + PyEval_InitThreads(); + + Py_Initialize(); + + main = boost::python::import("__main__"); + + python::object main_namespace = main.attr("__dict__"); + + // делаем аналог from pykd import * + python::object pykd = boost::python::import( "pykd" ); + + python::dict pykd_namespace( pykd.attr("__dict__") ); + + python::list iterkeys( pykd_namespace.iterkeys() ); + + for (int i = 0; i < boost::python::len(iterkeys); i++) + { + std::string key = boost::python::extract(iterkeys[i]); + + main_namespace[ key ] = pykd_namespace[ key ]; + } + + pyState = PyEval_SaveThread(); +} +volatile LONG WindbgGlobalSession::sessionCount = 0; + +WindbgGlobalSession *WindbgGlobalSession::windbgGlobalSession = NULL; //////////////////////////////////////////////////////////////////////////////// @@ -43,7 +80,7 @@ DebugExtensionInitialize( *Version = DEBUG_EXTENSION_VERSION( 1, 0 ); *Flags = 0; -// WindbgGlobalSession::StartWindbgSession(); + WindbgGlobalSession::StartWindbgSession(); return S_OK; } @@ -54,7 +91,7 @@ VOID CALLBACK DebugExtensionUninitialize() { -// WindbgGlobalSession::StopWindbgSession(); + WindbgGlobalSession::StopWindbgSession(); } //////////////////////////////////////////////////////////////////////////////// @@ -63,7 +100,110 @@ HRESULT CALLBACK py( PDEBUG_CLIENT4 client, PCSTR args ) { - return S_OK; + g_dbgEng.setClient( client ); + + WindbgGlobalSession::RestorePyState(); + + PyThreadState *globalInterpreter = PyThreadState_Swap( NULL ); + PyThreadState *localInterpreter = Py_NewInterpreter(); + + try { + + // получаем достпу к глобальному мапу ( нужен для вызова exec_file ) + python::object main = python::import("__main__"); + + python::object global(main.attr("__dict__")); + + // настраиваем ввод/вывод ( чтобы в скрипте можно было писать print ) + + python::object sys = python::import("sys"); + + sys.attr("stdout") = python::object( DbgOut() ); + sys.attr("stderr") = python::object( DbgErr() ); + sys.attr("stdin") = python::object( DbgIn() ); + + // импортируем модуль обработки исключений ( нужен для вывода traceback а ) + python::object tracebackModule = python::import("traceback"); + + // разбор параметров + typedef boost::escaped_list_separator char_separator_t; + typedef boost::tokenizer< char_separator_t > char_tokenizer_t; + + std::string argsStr( args ); + + char_tokenizer_t token( argsStr , char_separator_t( "", " \t", "\"" ) ); + std::vector argsList; + + for ( char_tokenizer_t::iterator it = token.begin(); it != token.end(); ++it ) + { + if ( *it != "" ) + argsList.push_back( *it ); + } + + if ( argsList.size() == 0 ) + return S_OK; + + char **pythonArgs = new char* [ argsList.size() ]; + + for ( size_t i = 0; i < argsList.size(); ++i ) + pythonArgs[i] = const_cast( argsList[i].c_str() ); + + PySys_SetArgv( (int)argsList.size(), pythonArgs ); + + delete[] pythonArgs; + + // найти путь к файлу + std::string fullScriptName; + DbgPythonPath dbgPythonPath; + + if ( !dbgPythonPath.getFullFileName( argsList[0], fullScriptName ) ) + { + eprintln( L"script file not found" ); + } + else + try { + + python::object result; + + result = python::exec_file( fullScriptName.c_str(), global, global ); + } + catch( boost::python::error_already_set const & ) + { + // ошибка в скрипте + PyObject *errtype = NULL, *errvalue = NULL, *traceback = NULL; + + PyErr_Fetch( &errtype, &errvalue, &traceback ); + + PyErr_NormalizeException( &errtype, &errvalue, &traceback ); + + std::wstringstream sstr; + + python::object lst = + python::object( tracebackModule.attr("format_exception" ) )( + python::handle<>( errtype ), + python::handle<>( python::allow_null( errvalue ) ), + python::handle<>( python::allow_null( traceback ) ) ); + + sstr << std::endl << std::endl; + + for ( long i = 0; i < python::len(lst); ++i ) + sstr << std::wstring( python::extract(lst[i]) ) << std::endl; + + eprintln( sstr.str() ); + } + + } + catch(...) + { + eprintln( L"unexpected error" ); + } + + Py_EndInterpreter( localInterpreter ); + PyThreadState_Swap( globalInterpreter ); + + WindbgGlobalSession::SavePyState(); + + return S_OK; } //////////////////////////////////////////////////////////////////////////////// @@ -72,248 +212,38 @@ HRESULT CALLBACK pycmd( PDEBUG_CLIENT4 client, PCSTR args ) { - return S_OK; + g_dbgEng.setClient( client ); + + WindbgGlobalSession::RestorePyState(); + + try { + + // перенаправление стандартных потоков ВВ + python::object sys = python::import("sys"); + + sys.attr("stdout") = python::object( DbgOut() ); + sys.attr("stderr") = python::object( DbgErr() ); + sys.attr("stdin") = python::object( DbgIn() ); + + PyRun_String( + "__import__('code').InteractiveConsole(__import__('__main__').__dict__).interact()", + Py_file_input, + WindbgGlobalSession::global().ptr(), + WindbgGlobalSession::global().ptr() + ); + + // выход из интерпретатора происходит через исключение raise SystemExit(code) + // которое потом может помешать исполнению callback ов + PyErr_Clear(); + } + catch(...) + { + eprintln( L"unexpected error" ); + } + + WindbgGlobalSession::SavePyState(); + + return S_OK; } //////////////////////////////////////////////////////////////////////////////// - - - - - - - - - -////////////////////////////////////////////////////////////////////////////////// -// -//extern "C" void initpykd(); -// -////////////////////////////////////////////////////////////////////////////////// -// -//WindbgGlobalSession::WindbgGlobalSession() { -// -// PyImport_AppendInittab("pykd", initpykd ); -// -// PyEval_InitThreads(); -// -// Py_Initialize(); -// -// main = boost::python::import("__main__"); -// -// python::object main_namespace = main.attr("__dict__"); -// -// // делаем аналог from pykd import * -// python::object pykd = boost::python::import( "pykd" ); -// -// python::dict pykd_namespace( pykd.attr("__dict__") ); -// -// python::list iterkeys( pykd_namespace.iterkeys() ); -// -// for (int i = 0; i < boost::python::len(iterkeys); i++) -// { -// std::string key = boost::python::extract(iterkeys[i]); -// -// main_namespace[ key ] = pykd_namespace[ key ]; -// } -// -// pyState = PyEval_SaveThread(); -//} -// -// -//volatile LONG WindbgGlobalSession::sessionCount = 0; -// -//WindbgGlobalSession *WindbgGlobalSession::windbgGlobalSession = NULL; -// -/////////////////////////////////////////////////////////////////////////////////// -// -//HRESULT -//CALLBACK -//DebugExtensionInitialize( -// OUT PULONG Version, -// OUT PULONG Flags ) -//{ -// *Version = DEBUG_EXTENSION_VERSION( 1, 0 ); -// *Flags = 0; -// -// WindbgGlobalSession::StartWindbgSession(); -// -// return S_OK; -//} -// -////////////////////////////////////////////////////////////////////////////////// -// -//VOID -//CALLBACK -//DebugExtensionUninitialize() -//{ -// WindbgGlobalSession::StopWindbgSession(); -//} -// -////////////////////////////////////////////////////////////////////////////////// -// -//HRESULT -//CALLBACK -//py( PDEBUG_CLIENT4 client, PCSTR args ) -//{ -// DebugClientPtr dbgClient = DebugClient::createDbgClient( client ); -// DebugClientPtr oldClient = DebugClient::setDbgClientCurrent( dbgClient ); -// -// WindbgGlobalSession::RestorePyState(); -// -// PyThreadState *globalInterpreter = PyThreadState_Swap( NULL ); -// PyThreadState *localInterpreter = Py_NewInterpreter(); -// -// try { -// -// // получаем достпу к глобальному мапу ( нужен для вызова exec_file ) -// python::object main = python::import("__main__"); -// -// python::object global(main.attr("__dict__")); -// -// // настраиваем ввод/вывод ( чтобы в скрипте можно было писать print ) -// -// python::object sys = python::import("sys"); -// -// sys.attr("stdout") = python::object( dbgClient->dout() ); -// sys.attr("stderr") = python::object( dbgClient->dout() ); -// sys.attr("stdin") = python::object( dbgClient->din() ); -// -// // импортируем модуль обработки исключений ( нужен для вывода traceback а ) -// python::object tracebackModule = python::import("traceback"); -// -// // разбор параметров -// typedef boost::escaped_list_separator char_separator_t; -// typedef boost::tokenizer< char_separator_t > char_tokenizer_t; -// -// std::string argsStr( args ); -// -// char_tokenizer_t token( argsStr , char_separator_t( "", " \t", "\"" ) ); -// std::vector argsList; -// -// for ( char_tokenizer_t::iterator it = token.begin(); it != token.end(); ++it ) -// { -// if ( *it != "" ) -// argsList.push_back( *it ); -// } -// -// if ( argsList.size() == 0 ) -// return S_OK; -// -// char **pythonArgs = new char* [ argsList.size() ]; -// -// for ( size_t i = 0; i < argsList.size(); ++i ) -// pythonArgs[i] = const_cast( argsList[i].c_str() ); -// -// PySys_SetArgv( (int)argsList.size(), pythonArgs ); -// -// delete[] pythonArgs; -// -// // найти путь к файлу -// std::string fullScriptName; -// DbgPythonPath dbgPythonPath; -// -// if ( !dbgPythonPath.getFullFileName( argsList[0], fullScriptName ) ) -// { -// dbgClient->eprintln( L"script file not found" ); -// } -// else -// try { -// -// python::object result; -// -// result = python::exec_file( fullScriptName.c_str(), global, global ); -// } -// catch( boost::python::error_already_set const & ) -// { -// // ошибка в скрипте -// PyObject *errtype = NULL, *errvalue = NULL, *traceback = NULL; -// -// PyErr_Fetch( &errtype, &errvalue, &traceback ); -// -// PyErr_NormalizeException( &errtype, &errvalue, &traceback ); -// -// std::wstringstream sstr; -// -// python::object lst = -// python::object( tracebackModule.attr("format_exception" ) )( -// python::handle<>( errtype ), -// python::handle<>( python::allow_null( errvalue ) ), -// python::handle<>( python::allow_null( traceback ) ) ); -// -// sstr << std::endl << std::endl; -// -// for ( long i = 0; i < python::len(lst); ++i ) -// sstr << std::wstring( python::extract(lst[i]) ) << std::endl; -// -// dbgClient->eprintln( sstr.str() ); -// } -// -// } -// catch(...) -// { -// dbgClient->eprintln( L"unexpected error" ); -// } -// -// Py_EndInterpreter( localInterpreter ); -// PyThreadState_Swap( globalInterpreter ); -// -// WindbgGlobalSession::SavePyState(); -// -// DebugClient::setDbgClientCurrent( oldClient ); -// -// return S_OK; -//} -// -////////////////////////////////////////////////////////////////////////////////// -// -//HRESULT -//CALLBACK -//pycmd( PDEBUG_CLIENT4 client, PCSTR args ) -//{ -// if ( g_dbgClient->client() != client ) -// { -// DebugClientPtr dbgClient = DebugClient::createDbgClient( client ); -// DebugClient::setDbgClientCurrent( dbgClient ); -// } -// -// WindbgGlobalSession::RestorePyState(); -// -// ULONG mask = 0; -// client->GetOutputMask( &mask ); -// -// try { -// -// // перенаправление стандартных потоков ВВ -// python::object sys = python::import("sys"); -// -// sys.attr("stdout") = python::object( DbgOut( client ) ); -// sys.attr("stderr") = python::object( DbgOut( client ) ); -// sys.attr("stdin") = python::object( DbgIn( client ) ); -// -// client->SetOutputMask( DEBUG_OUTPUT_NORMAL ); -// -// PyRun_String( -// "__import__('code').InteractiveConsole(__import__('__main__').__dict__).interact()", -// Py_file_input, -// WindbgGlobalSession::global().ptr(), -// WindbgGlobalSession::global().ptr() -// ); -// -// // выход из интерпретатора происходит через исключение raise SystemExit(code) -// // которое потом может помешать исполнению callback ов -// PyErr_Clear(); -// } -// catch(...) -// { -// //dbgClient->eprintln( L"unexpected error" ); -// } -// -// client->SetOutputMask( mask ); -// -// WindbgGlobalSession::SavePyState(); -// -// return S_OK; -//} -// -////////////////////////////////////////////////////////////////////////////////// diff --git a/pykd/dbgio.cpp b/pykd/dbgio.cpp deleted file mode 100644 index fb09709..0000000 --- a/pykd/dbgio.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include "stdafx.h" - -#include - -#include "dbgio.h" -#include "dbgclient.h" -#include "windbg.h" - -namespace pykd { - -/////////////////////////////////////////////////////////////////////////////////// - -void DebugClient::dprint( const std::wstring &str, bool dml ) -{ - if ( WindbgGlobalSession::isInit() ) - { - for ( size_t i = 0; i < str.size() / 100 + 1; ++i ) - { - m_control->ControlledOutputWide( - dml ? DEBUG_OUTCTL_AMBIENT_DML : DEBUG_OUTCTL_AMBIENT_TEXT, DEBUG_OUTPUT_NORMAL, - L"%ws", - str.substr( i*100, min( str.size() - i*100, 100 ) ).c_str() - ); - } - } - else - { - python::object sys = python::import("sys"); - sys.attr("stdout").attr("write")( str ); - } -} - -void dprint( const std::wstring &str, bool dml ) -{ - g_dbgClient->dprint( str, dml ); -} - - -/////////////////////////////////////////////////////////////////////////////////// - -void DebugClient::dprintln( const std::wstring &str, bool dml ) -{ - this->dprint( str + L"\r\n", dml ); -} - -void dprintln( const std::wstring &str, bool dml ) -{ - g_dbgClient->dprintln( str, dml ); -} - -/////////////////////////////////////////////////////////////////////////////////// - -void DebugClient::eprint( const std::wstring &str ) -{ - if ( WindbgGlobalSession::isInit() ) - { - for ( size_t i = 0; i < str.size() / 100 + 1; ++i ) - { - m_control->OutputWide( - DEBUG_OUTPUT_ERROR, - L"%ws", - str.substr( i*100, min( str.size() - i*100, 100 ) ).c_str() - ); - } - } - else - { - python::object sys = python::import("sys"); - sys.attr("stderr").attr("write")( str ); - } -} - -void eprint( const std::wstring &str ) -{ - g_dbgClient->eprint( str ); -} - -/////////////////////////////////////////////////////////////////////////////////// - -void DebugClient::eprintln( const std::wstring &str ) -{ - this->eprint( str + L"\r\n"); -} - -void eprintln( const std::wstring &str ) -{ - g_dbgClient->eprintln( str ); -} - -/////////////////////////////////////////////////////////////////////////////////// - -void -DbgOut::write( const std::wstring &str ) -{ - if ( WindbgGlobalSession::isInit() ) - { - for ( size_t i = 0; i < str.size() / 100 + 1; ++i ) - { - m_control->ControlledOutputWide( - DEBUG_OUTCTL_AMBIENT_TEXT, - DEBUG_OUTPUT_NORMAL, - L"%ws", - str.substr( i*100, min( str.size() - i*100, 100 ) ).c_str() - ); - } - } - else - { - python::object sys = python::import("sys"); - sys.attr("stderr").attr("write")( str ); - } -} - -/////////////////////////////////////////////////////////////////////////////////// - -std::string -DbgIn::readline() -{ - char str[0x100]; - ULONG inputSize = 0; - - m_control->Input( str, sizeof(str), &inputSize ); - - return std::string( str ) + "\n"; -} - -/////////////////////////////////////////////////////////////////////////////////// - -}; // namesapce pykd diff --git a/pykd/dbgio.h b/pykd/dbgio.h deleted file mode 100644 index aaf7e59..0000000 --- a/pykd/dbgio.h +++ /dev/null @@ -1,183 +0,0 @@ -#pragma once - -#include "dbgobj.h" -#include - -namespace pykd { - -/////////////////////////////////////////////////////////////////////////////////// - -void dprint( const std::wstring &str, bool dml = false ); - -void dprintln( const std::wstring &str, bool dml = false ); - -void eprint( const std::wstring &str ); - -void eprintln( const std::wstring &str ); - -///////////////////////////////////////////////////////////////////////////////// - -class DbgOut : private DbgObject { - -public: - - DbgOut( IDebugClient4 *client ) : DbgObject( client ) - {} - - void - write( const std::wstring &str ); -}; - -///////////////////////////////////////////////////////////////////////////////// - -class DbgIn : private DbgObject { - -public: - - DbgIn( IDebugClient4 *client ) : DbgObject( client ) - {} - - std::string - readline(); -}; - -///////////////////////////////////////////////////////////////////////////////// - -// класс для перехвата вывода в отладчик - -class OutputReader : private DbgObject, public IDebugOutputCallbacks, private boost::noncopyable { - -public: - - explicit OutputReader( IDebugClient4 *client ) : DbgObject( client ) - { - HRESULT hres; - - hres = m_client->GetOutputCallbacks( &m_previousCallback ); - if ( FAILED( hres ) ) - throw DbgException( "IDebugClient::GetOutputCallbacks failed" ); - - hres = m_client->SetOutputCallbacks( this ); - if ( FAILED( hres ) ) - throw DbgException( "IDebugClient::GetOutputCallbacks failed" ); - - } - - ~OutputReader() - { - m_client->SetOutputCallbacks( m_previousCallback ); - } - - const std::string& - Line() const { - return m_readLine; - } - -private: - - // IUnknown. - STDMETHOD(QueryInterface)( - __in REFIID InterfaceId, - __out PVOID* Interface ) { - return E_NOINTERFACE; - } - - STDMETHOD_(ULONG, AddRef)() { - return 1L; - } - - - STDMETHOD_(ULONG, Release)() { - return 0L; - } - - STDMETHOD(Output)( - __in ULONG Mask, - __in PCSTR Text ) - { - if ( Mask == DEBUG_OUTPUT_NORMAL ) - { - m_readLine += std::string( Text ); - } - - return S_OK; - } - -private: - - std::string m_readLine; - - CComPtr m_previousCallback; -}; - -/////////////////////////////////////////////////////////////////////////////////// -// -//class InputReader : public IDebugInputCallbacks, private DbgObject, private boost::noncopyable { -// -//public: -// -// explicit InputReader( IDebugClient4 *debugClient ) : DbgObject( debugClient ) -// { -// HRESULT hres; -// -// hres = m_client->GetInputCallbacks( &m_previousCallback ); -// if ( FAILED( hres ) ) -// throw DbgException( "IDebugClient::GetInputCallbacks failed" ); -// -// hres = m_client->SetInputCallbacks( this ); -// if ( FAILED( hres ) ) -// throw DbgException( "IDebugClient::SetInputCallbacks failed" ); -// } -// -// ~InputReader() -// { -// if ( m_previousCallback ) -// m_client->SetInputCallbacks( m_previousCallback ); -// } -// -// -//private: -// -// // IUnknown. -// STDMETHOD(QueryInterface)( -// __in REFIID InterfaceId, -// __out PVOID* Interface ) { -// return E_NOINTERFACE; -// } -// -// STDMETHOD_(ULONG, AddRef)() { -// return 1L; -// } -// -// -// STDMETHOD_(ULONG, Release)() { -// return 0L; -// } -// -// STDMETHOD( EndInput )() { -// return S_OK; -// } -// -// STDMETHOD( StartInput )( -// IN ULONG BufferSize ) { -// -// std::vector buf(BufferSize); -// -// ULONG inputSize; -// -// m_control->Input( &buf[0], BufferSize, &inputSize ); -// -// m_control->ReturnInput( &buf[0] ); -// -// return S_OK; -// } -// -//private: -// -// CComPtr m_previousCallback; -// -//}; - -///////////////////////////////////////////////////////////////////////////////// - -}; \ No newline at end of file diff --git a/pykd/pykd_2008.vcproj b/pykd/pykd_2008.vcproj index 05ce6fe..79d6600 100644 --- a/pykd/pykd_2008.vcproj +++ b/pykd/pykd_2008.vcproj @@ -365,6 +365,10 @@ RelativePath=".\dbgmem.cpp" > + + @@ -463,6 +467,10 @@ RelativePath=".\dbgmem.h" > + + @@ -545,6 +553,14 @@ RelativePath=".\win\dbgeng.h" > + + + + @@ -553,6 +569,10 @@ RelativePath=".\win\utils.h" > + + ( "dout", "dout", python::no_init ) + .def( "write", &DbgOut::write ); + python::class_( "dout", "dout", python::no_init ) + .def( "write", &DbgErr::write ); + python::class_( "din", "din", python::no_init ) + .def( "readline", &DbgIn::readline ); + // system properties python::def( "ptrSize", &ptrSize, "Return effective pointer size" ); diff --git a/pykd/stdafx.h b/pykd/stdafx.h index 5f8e083..8367440 100644 --- a/pykd/stdafx.h +++ b/pykd/stdafx.h @@ -59,3 +59,4 @@ namespace python = boost::python; #include #include +#include diff --git a/pykd/win/dbgeng.cpp b/pykd/win/dbgeng.cpp index 8f345a1..b7a0ee8 100644 --- a/pykd/win/dbgeng.cpp +++ b/pykd/win/dbgeng.cpp @@ -104,7 +104,6 @@ void loadDump( const std::wstring &fileName ) hres = g_dbgEng->control->WaitForEvent(DEBUG_WAIT_DEFAULT, INFINITE); if ( FAILED( hres ) ) throw DbgException( "IDebugControl::WaitForEvent failed" ); - } /////////////////////////////////////////////////////////////////////////////////// @@ -169,7 +168,8 @@ void debugGo() } while( currentStatus != DEBUG_STATUS_BREAK && currentStatus != DEBUG_STATUS_NO_DEBUGGEE ); } -/////////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////////// ULONG64 findModuleBase( const std::string &moduleName ) { diff --git a/pykd/win/dbgeng.h b/pykd/win/dbgeng.h index 3550431..02c3117 100644 --- a/pykd/win/dbgeng.h +++ b/pykd/win/dbgeng.h @@ -56,6 +56,11 @@ public: return m_bind.get(); } + void setClient( PDEBUG_CLIENT4 client ) + { + m_bind.reset(new DbgEngBind(client) ); + } + private: std::auto_ptr m_bind; @@ -66,6 +71,6 @@ private: extern DebugEngine g_dbgEng; -/////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////// }; \ No newline at end of file diff --git a/pykd/dbgpath.cpp b/pykd/win/dbgpath.cpp similarity index 100% rename from pykd/dbgpath.cpp rename to pykd/win/dbgpath.cpp diff --git a/pykd/dbgpath.h b/pykd/win/dbgpath.h similarity index 100% rename from pykd/dbgpath.h rename to pykd/win/dbgpath.h diff --git a/pykd/windbg.h b/pykd/win/windbg.h similarity index 86% rename from pykd/windbg.h rename to pykd/win/windbg.h index c0c98fa..a19ae83 100644 --- a/pykd/windbg.h +++ b/pykd/win/windbg.h @@ -1,6 +1,5 @@ #pragma once - namespace pykd { /////////////////////////////////////////////////////////////////////////////////// @@ -64,13 +63,12 @@ private: PyThreadState *pyState; - static volatile LONG sessionCount; + static volatile LONG sessionCount; - static WindbgGlobalSession *windbgGlobalSession; + static WindbgGlobalSession *windbgGlobalSession; }; /////////////////////////////////////////////////////////////////////////////////// - }; // namespace pykd \ No newline at end of file