Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
pykd
pykd-ext
Commits
d703b5e6
Commit
d703b5e6
authored
Jan 06, 2021
by
ussrhero
Browse files
Merge branch 'fix_windbg_preview_echo' into 'master'
fixed absent echo in windbg preview See merge request
!5
parents
53b68c33
0992faa1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
8 deletions
+32
-8
sources/pyinterpret.cpp
sources/pyinterpret.cpp
+7
-3
sources/version.h
sources/version.h
+1
-1
sources/windbgext.cpp
sources/windbgext.cpp
+24
-4
No files found.
sources/pyinterpret.cpp
View file @
d703b5e6
...
...
@@ -286,7 +286,6 @@ std::auto_ptr<PythonSingleton> PythonSingleton::m_singleton;
HMODULE
LoadPythonForKey
(
HKEY
installPathKey
,
int
majorVersion
,
int
minorVersion
)
{
HMODULE
hmodule
=
NULL
;
char
installPath
[
1000
];
...
...
@@ -300,14 +299,19 @@ HMODULE LoadPythonForKey(HKEY installPathKey, int majorVersion, int minorVersion
std
::
stringstream
imagePath
;
imagePath
<<
installPath
<<
dllName
.
str
();
//load by full string
hmodule
=
LoadLibraryA
(
imagePath
.
str
().
c_str
());
if
(
hmodule
)
return
hmodule
;
hmodule
=
LoadLibraryExA
(
imagePath
.
str
().
c_str
(),
NULL
,
LOAD_WITH_ALTERED_SEARCH_PATH
);
if
(
hmodule
)
return
hmodule
;
//search in common places as system32
hmodule
=
LoadLibraryA
(
dllName
.
str
().
c_str
());
if
(
hmodule
)
return
hmodule
;
}
return
NULL
;
...
...
sources/version.h
View file @
d703b5e6
...
...
@@ -3,7 +3,7 @@
#define PYKDEXT_VERSION_MAJOR 2
#define PYKDEXT_VERSION_MINOR 0
#define PYKDEXT_VERSION_SUBVERSION 0
#define PYKDEXT_VERSION_BUILDNO 2
4
#define PYKDEXT_VERSION_BUILDNO 2
5
#define __VER_STR2__(x) #x
#define __VER_STR1__(x) __VER_STR2__(x)
...
...
sources/windbgext.cpp
View file @
d703b5e6
...
...
@@ -19,7 +19,7 @@
//////////////////////////////////////////////////////////////////////////////
static
int
defaultMajorVersion
=
3
;
static
int
defaultMinorVersion
=
8
;
static
int
defaultMinorVersion
=
9
;
//////////////////////////////////////////////////////////////////////////////
...
...
@@ -301,6 +301,19 @@ help(
//////////////////////////////////////////////////////////////////////////////
bool
isClassicWindbg
()
{
std
::
vector
<
wchar_t
>
exebuffer
(
0x10000
);
auto
exePathLength
=
GetModuleFileName
(
NULL
,
exebuffer
.
data
(),
static_cast
<
DWORD
>
(
exebuffer
.
size
()));
std
::
wstring
exepath
{
exebuffer
.
data
(),
exePathLength
};
const
std
::
wstring
windbgexe
{
L"windbg.exe"
};
return
(
exepath
.
size
()
>=
windbgexe
.
size
())
&&
(
exepath
.
rfind
(
windbgexe
)
==
exepath
.
size
()
-
windbgexe
.
size
());
}
//////////////////////////////////////////////////////////////////////////////
static
const
std
::
regex
shebangRe
(
"^#!
\\
s*python([2,3])(?:
\\
.(
\\
d))?$"
);
...
...
@@ -320,7 +333,14 @@ py(
{
ULONG
oldMask
;
client
->
GetOutputMask
(
&
oldMask
);
client
->
SetOutputMask
(
(
oldMask
&
~
DEBUG_OUTPUT_PROMPT
)
|
DEBUG_OUTPUT_STATUS
);
ULONG
mask
=
oldMask
|
DEBUG_OUTPUT_STATUS
;
if
(
isClassicWindbg
())
{
mask
=
mask
&
~
DEBUG_OUTPUT_PROMPT
;
}
client
->
SetOutputMask
(
mask
);
try
{
...
...
@@ -681,7 +701,7 @@ std::string getScriptFileName(const std::string &scriptName)
NULL
,
scriptName
.
c_str
(),
ext
,
pathBuffer
.
size
(),
static_cast
<
DWORD
>
(
pathBuffer
.
size
()
)
,
&
pathBuffer
.
front
(),
NULL
);
...
...
@@ -779,7 +799,7 @@ void printString(PDEBUG_CLIENT client, ULONG mask, const char* str)
std
::
string
line
;
std
::
getline
(
sstr
,
line
);
if
(
prefer_dml
&&
mask
==
DEBUG_OUTPUT_ERROR
)
if
(
isClassicWindbg
()
&&
prefer_dml
&&
mask
==
DEBUG_OUTPUT_ERROR
)
{
line
=
std
::
regex_replace
(
line
,
std
::
regex
(
"&"
),
"&"
);
line
=
std
::
regex_replace
(
line
,
std
::
regex
(
"<"
),
"<"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment