Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
P
pykd-ext
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Todd Hartman
pykd-ext
Commits
4526f7c1
Commit
4526f7c1
authored
Oct 02, 2018
by
ussrhero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug
#1
parent
58e5b625
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
10 deletions
+39
-10
sources/windbgext.cpp
sources/windbgext.cpp
+39
-10
No files found.
sources/windbgext.cpp
View file @
4526f7c1
...
...
@@ -513,17 +513,46 @@ pip(
PyObjectRef
mainMod
=
PyImport_Import
(
mainName
);
PyObjectRef
globals
=
PyObject_GetAttrString
(
mainMod
,
"__dict__"
);
if
(
IsPy3
())
{
std
::
vector
<
std
::
wstring
>
argws
(
opts
.
args
.
size
()
+
1
);
std
::
stringstream
sstr
;
sstr
<<
"pip.main(["
;
for
(
auto
arg
:
opts
.
args
)
sstr
<<
'\''
<<
arg
<<
'\''
<<
','
;
sstr
<<
"])
\n
"
;
PyObjectRef
result
;
result
=
PyRun_String
(
"import pip
\n
"
,
Py_file_input
,
globals
,
globals
);
result
=
PyRun_String
(
"pip.logger.consumers = []
\n
"
,
Py_file_input
,
globals
,
globals
);
result
=
PyRun_String
(
sstr
.
str
().
c_str
(),
Py_file_input
,
globals
,
globals
);
argws
[
0
]
=
L"pip"
;
for
(
size_t
i
=
0
;
i
<
opts
.
args
.
size
();
++
i
)
argws
[
i
+
1
]
=
_bstr_t
(
opts
.
args
[
i
].
c_str
());
std
::
vector
<
wchar_t
*>
pythonArgs
(
argws
.
size
());
for
(
size_t
i
=
0
;
i
<
argws
.
size
();
++
i
)
pythonArgs
[
i
]
=
const_cast
<
wchar_t
*>
(
argws
[
i
].
c_str
());
PySys_SetArgv_Py3
((
int
)
argws
.
size
(),
&
pythonArgs
[
0
]);
std
::
stringstream
sstr
;
sstr
<<
"runpy.run_module('pip', run_name='__main__', alter_sys=True)"
<<
std
::
endl
;
PyObjectRef
result
;
result
=
PyRun_String
(
"import runpy
\n
"
,
Py_file_input
,
globals
,
globals
);
result
=
PyRun_String
(
sstr
.
str
().
c_str
(),
Py_file_input
,
globals
,
globals
);
}
else
{
std
::
vector
<
char
*>
pythonArgs
(
opts
.
args
.
size
()
+
1
);
pythonArgs
[
0
]
=
"pip"
;
for
(
size_t
i
=
0
;
i
<
opts
.
args
.
size
();
++
i
)
pythonArgs
[
i
+
1
]
=
const_cast
<
char
*>
(
opts
.
args
[
i
].
c_str
());
PySys_SetArgv
((
int
)
pythonArgs
.
size
(),
&
pythonArgs
[
0
]);
std
::
stringstream
sstr
;
sstr
<<
"runpy.run_module('pip', run_name='__main__', alter_sys=True)"
<<
std
::
endl
;
PyObjectRef
result
;
result
=
PyRun_String
(
"import runpy
\n
"
,
Py_file_input
,
globals
,
globals
);
result
=
PyRun_String
(
sstr
.
str
().
c_str
(),
Py_file_input
,
globals
,
globals
);
}
handleException
();
}
...
...
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