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
m417z
pykd
Commits
5f0d7125
Commit
5f0d7125
authored
Jan 10, 2019
by
Aleksey R.
Browse files
add: addSyntheticModule, removeSyntheticModule
parent
99b48ad0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
2 deletions
+40
-2
kdlibcpp
kdlibcpp
+1
-1
pykd/pydbgeng.cpp
pykd/pydbgeng.cpp
+16
-0
pykd/pydbgeng.h
pykd/pydbgeng.h
+3
-0
pykd/pymod.cpp
pykd/pymod.cpp
+8
-1
test/scripts/synsymtest.py
test/scripts/synsymtest.py
+12
-0
No files found.
kdlibcpp
@
7c3fcfbf
Compare
9126f440
...
7c3fcfbf
Subproject commit
9126f4406b47281a331c3022c24eb5de73ca828c
Subproject commit
7c3fcfbf80300cf100b6fe98d40662a1c56041b4
pykd/pydbgeng.cpp
View file @
5f0d7125
...
...
@@ -213,4 +213,20 @@ std::wstring printSyntheticSymbol(const kdlib::SyntheticSymbol& syntheticSymbol)
///////////////////////////////////////////////////////////////////////////////
void
addSyntheticModule
(
kdlib
::
MEMOFFSET_64
base
,
unsigned
long
size
,
const
std
::
wstring
&
name
,
const
std
::
wstring
&
path
/*= std::wstring{}*/
)
{
AutoRestorePyState
pystate
;
return
kdlib
::
addSyntheticModule
(
base
,
size
,
name
,
path
);
}
///////////////////////////////////////////////////////////////////////////////
void
removeSyntheticModule
(
kdlib
::
MEMOFFSET_64
base
)
{
AutoRestorePyState
pystate
;
return
kdlib
::
removeSyntheticModule
(
base
);
}
///////////////////////////////////////////////////////////////////////////////
}
//end namespace pykd
pykd/pydbgeng.h
View file @
5f0d7125
...
...
@@ -456,6 +456,9 @@ kdlib::SyntheticSymbol addSyntheticSymbol( kdlib::MEMOFFSET_64 offset, unsigned
void
removeSyntheticSymbol
(
const
kdlib
::
SyntheticSymbol
&
syntheticSymbol
);
std
::
wstring
printSyntheticSymbol
(
const
kdlib
::
SyntheticSymbol
&
syntheticSymbol
);
void
addSyntheticModule
(
kdlib
::
MEMOFFSET_64
base
,
unsigned
long
size
,
const
std
::
wstring
&
name
,
const
std
::
wstring
&
path
=
std
::
wstring
{});
void
removeSyntheticModule
(
kdlib
::
MEMOFFSET_64
base
);
///////////////////////////////////////////////////////////////////////////////
}
//end namespace pykd
pykd/pymod.cpp
View file @
5f0d7125
...
...
@@ -106,6 +106,8 @@ BOOST_PYTHON_FUNCTION_OVERLOADS( getTypeInfoProviderFromPdb_, pykd::getTypeInfoP
BOOST_PYTHON_FUNCTION_OVERLOADS
(
getTypeInfoProviderFromSource_
,
pykd
::
getTypeInfoProviderFromSource
,
1
,
2
);
BOOST_PYTHON_FUNCTION_OVERLOADS
(
evalExpr_
,
pykd
::
evalExpr
,
1
,
3
);
BOOST_PYTHON_FUNCTION_OVERLOADS
(
addSyntheticModule_
,
pykd
::
addSyntheticModule
,
3
,
4
);
namespace
pykd
{
void
initialize
()
...
...
@@ -599,7 +601,6 @@ void pykd_init()
python
::
def
(
"appendSrcPath"
,
pykd
::
appendSrcPath
,
"Append current source path"
);
// synthetic symbol
python
::
def
(
"addSyntheticSymbol"
,
pykd
::
addSyntheticSymbol
,
"The addSyntheticSymbol function adds a synthetic symbol to a module in the current process
\n
"
...
...
@@ -607,6 +608,12 @@ void pykd_init()
python
::
def
(
"removeSyntheticSymbol"
,
pykd
::
removeSyntheticSymbol
,
"The removeSyntheticSymbol function removes a synthetic symbol from a module in the current proces"
);
// synthetic module
python
::
def
(
"addSyntheticModule"
,
pykd
::
addSyntheticModule
,
addSyntheticModule_
(
python
::
args
(
"base"
,
"size"
,
"name"
,
"path"
),
"The addSyntheticModule function adds a synthetic module to the module list the debugger maintains for the current process"
));
python
::
def
(
"removeSyntheticModule"
,
pykd
::
removeSyntheticModule
,
"The removeSyntheticModule function removes a synthetic module from the module list the debugger maintains for the current process"
);
// secondary callback data
python
::
def
(
"enumTagged"
,
pykd
::
enumTagged
,
"Return the list of secondary callback data IDs (as a strings)"
);
...
...
test/scripts/synsymtest.py
View file @
5f0d7125
...
...
@@ -28,3 +28,15 @@ class SynSymTest(unittest.TestCase):
self
.
assertRaises
(
pykd
.
DbgException
,
target
.
module
.
offset
,
"synSym2"
)
self
.
assertRaises
(
pykd
.
DbgException
,
pykd
.
removeSyntheticSymbol
,
_synsym
)
def
testModule
(
self
):
"""Add and remove synthetic module"""
base
=
64
*
1024
pykd
.
addSyntheticModule
(
base
,
1024
,
"artificial_module1"
)
pykd
.
addSyntheticModule
(
base
+
1024
,
1024
,
"artificial_module2"
,
"artificial_module2_path"
)
pykd
.
removeSyntheticSymbol
(
pykd
.
addSyntheticSymbol
(
base
,
1
,
"artificial_symbol"
)
)
pykd
.
removeSyntheticModule
(
base
+
1024
)
pykd
.
removeSyntheticModule
(
base
)
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