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
kdlibcpp
Commits
16d787b4
Commit
16d787b4
authored
Apr 20, 2019
by
ussrhero
Browse files
Merge branch 'inline_functions' into 'dev-1.0'
Inline functions See merge request
kdlibcpp/kdlibcpp!18
parents
54d600a4
45dbf40c
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
654 additions
and
279 deletions
+654
-279
kdlib/include/kdlib/stack.h
kdlib/include/kdlib/stack.h
+6
-1
kdlib/include/kdlib/symengine.h
kdlib/include/kdlib/symengine.h
+4
-0
kdlib/include/kdlib/typedvar.h
kdlib/include/kdlib/typedvar.h
+2
-0
kdlib/source/dia/diaload.cpp
kdlib/source/dia/diaload.cpp
+10
-0
kdlib/source/dia/diawrapper.cpp
kdlib/source/dia/diawrapper.cpp
+64
-9
kdlib/source/dia/diawrapper.h
kdlib/source/dia/diawrapper.h
+46
-46
kdlib/source/dia/symexport.cpp
kdlib/source/dia/symexport.cpp
+10
-0
kdlib/source/net/netobject.h
kdlib/source/net/netobject.h
+81
-36
kdlib/source/stack.cpp
kdlib/source/stack.cpp
+50
-2
kdlib/source/stackimpl.h
kdlib/source/stackimpl.h
+38
-28
kdlib/source/typedvar.cpp
kdlib/source/typedvar.cpp
+41
-3
kdlib/source/typedvarimp.h
kdlib/source/typedvarimp.h
+132
-86
kdlib/source/typeinfo.cpp
kdlib/source/typeinfo.cpp
+4
-0
kdlib/source/win/cpucontext.cpp
kdlib/source/win/cpucontext.cpp
+165
-67
kdlib/source/win/dbgmgr.h
kdlib/source/win/dbgmgr.h
+1
-1
kdlib/tests/dumps/targetapp_stacktest_wow64/targetapp.pdb
kdlib/tests/dumps/targetapp_stacktest_wow64/targetapp.pdb
+0
-0
kdlib/tests/dumps/targetapp_stacktest_wow64/targetapp_stacktest_wow64.cab
...s/targetapp_stacktest_wow64/targetapp_stacktest_wow64.cab
+0
-0
kdlib/tests/dumps/targetapp_stacktest_wow64_release/targetapp.pdb
...sts/dumps/targetapp_stacktest_wow64_release/targetapp.pdb
+0
-0
kdlib/tests/dumps/targetapp_stacktest_wow64_release/targetapp_stacktest_wow64_release.cab
...ktest_wow64_release/targetapp_stacktest_wow64_release.cab
+0
-0
kdlib/tests/dumps/targetapp_stacktest_x64_release/targetapp.pdb
...tests/dumps/targetapp_stacktest_x64_release/targetapp.pdb
+0
-0
No files found.
kdlib/include/kdlib/stack.h
View file @
16d787b4
...
...
@@ -47,6 +47,11 @@ public:
virtual
bool
findStaticVar
(
const
std
::
wstring
&
varName
)
=
0
;
virtual
void
switchTo
()
=
0
;
virtual
bool
isInline
()
=
0
;
virtual
TypedVarPtr
getFunction
()
=
0
;
virtual
std
::
wstring
getSymbol
(
bool
showDisplacement
=
true
)
=
0
;
virtual
void
getSourceLine
(
std
::
wstring
&
fileName
,
unsigned
long
&
lineNo
)
=
0
;
};
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -66,7 +71,7 @@ public:
///////////////////////////////////////////////////////////////////////////////
StackPtr
getStack
();
StackPtr
getStack
(
bool
inlineFrames
=
false
);
StackFramePtr
getCurrentStackFrame
();
unsigned
long
getCurrentStackFrameNumber
();
void
setCurrentStackFrame
(
const
StackFramePtr
&
stackFrame
);
...
...
kdlib/include/kdlib/symengine.h
View file @
16d787b4
...
...
@@ -55,6 +55,8 @@ enum SymTags
SymTagCustomType
,
SymTagManagedType
,
SymTagDimension
,
SymTagCallSite
,
SymTagInlineSite
,
SymTagMax
};
...
...
@@ -209,6 +211,8 @@ public:
virtual
SymbolPtr
getClassParent
()
=
0
;
// "this" for method
virtual
SymbolPtr
getVirtualTableShape
()
=
0
;
virtual
unsigned
long
getVirtualBaseOffset
()
=
0
;
virtual
SymbolPtrList
findInlineFramesByVA
(
MEMOFFSET_64
)
=
0
;
virtual
void
getInlineSourceLine
(
MEMOFFSET_64
,
std
::
wstring
&
fileName
,
unsigned
long
&
lineNo
)
=
0
;
};
///////////////////////////////////////////////////////////////////////////////
...
...
kdlib/include/kdlib/typedvar.h
View file @
16d787b4
...
...
@@ -134,6 +134,8 @@ public:
virtual
TypedValue
call
(
const
TypedValueList
&
arglst
)
=
0
;
virtual
void
setElement
(
const
std
::
wstring
&
fieldName
,
const
TypedValue
&
value
)
=
0
;
virtual
void
setElement
(
size_t
index
,
const
TypedValue
&
value
)
=
0
;
virtual
TypedVarList
getInlineFunctions
(
MEMOFFSET_64
offset
)
=
0
;
virtual
void
getSourceLine
(
MEMOFFSET_64
offset
,
std
::
wstring
&
fileName
,
unsigned
long
&
lineno
)
=
0
;
protected:
...
...
kdlib/source/dia/diaload.cpp
View file @
16d787b4
...
...
@@ -510,6 +510,16 @@ public:
{
NOT_IMPLEMENTED
();
}
SymbolPtrList
findInlineFramesByVA
(
MEMOFFSET_64
va
)
override
{
NOT_IMPLEMENTED
();
}
void
getInlineSourceLine
(
MEMOFFSET_64
,
std
::
wstring
&
fileName
,
unsigned
long
&
lineNo
)
override
{
NOT_IMPLEMENTED
();
}
};
...
...
kdlib/source/dia/diawrapper.cpp
View file @
16d787b4
...
...
@@ -424,7 +424,7 @@ ULONG DiaSymbol::getRegisterId()
////////////////////////////////////////////////////////////////////////////////
ULONG
DiaSymbol
::
getRegRealativeId
()
unsigned
long
DiaSymbol
::
getRegRealativeId
()
{
switch
(
m_machineType
)
{
...
...
@@ -492,13 +492,6 @@ bool DiaSymbol::isUndecorated(const std::wstring &undecName)
////////////////////////////////////////////////////////////////////////////////
ULONG
DiaSymbol
::
getIndexId
()
{
return
callSymbol
(
get_symIndexId
);
}
////////////////////////////////////////////////////////////////////////////////
SymbolPtr
DiaSymbol
::
getIndexType
()
{
DiaSymbolPtr
diaSymbol
(
callSymbol
(
get_arrayIndexType
));
...
...
@@ -770,6 +763,68 @@ unsigned long DiaSymbol::getVirtualBaseOffset()
//////////////////////////////////////////////////////////////////////////////
SymbolPtrList
DiaSymbol
::
findInlineFramesByVA
(
MEMOFFSET_64
va
)
{
CComPtr
<
IDiaEnumSymbols
>
symEnum
;
HRESULT
hres
=
m_symbol
->
findInlineFramesByVA
(
va
,
&
symEnum
);
if
(
FAILED
(
hres
))
return
SymbolPtrList
();
LONG
count
;
hres
=
symEnum
->
get_Count
(
&
count
);
if
(
S_OK
!=
hres
)
throw
DiaException
(
L"Call IDiaSymbol::findInlineFramesByVA"
,
hres
);
SymbolPtrList
symList
;
for
(
auto
i
=
0
;
i
<
count
;
++
i
)
{
CComPtr
<
IDiaSymbol
>
sym
;
hres
=
symEnum
->
Item
(
i
,
&
sym
);
if
(
FAILED
(
hres
)
)
throw
DiaException
(
L"Call IDiaEnumSymbols::Item"
,
hres
);
SymbolPtr
symbol
(
new
DiaSymbol
(
sym
,
m_scope
,
m_machineType
));
symList
.
push_back
(
symbol
);
}
return
symList
;
}
//////////////////////////////////////////////////////////////////////////////
void
DiaSymbol
::
getInlineSourceLine
(
MEMOFFSET_64
offset
,
std
::
wstring
&
fileName
,
unsigned
long
&
lineNo
)
{
CComPtr
<
IDiaEnumLineNumbers
>
enumLineNumbers
;
HRESULT
hres
=
m_symbol
->
findInlineeLinesByVA
(
offset
,
1
,
&
enumLineNumbers
);
if
(
FAILED
(
hres
)
)
throw
DiaException
(
L"Call IDiaSymbol::findInlineeLinesByVA"
,
hres
);
DiaLineNumberPtr
sourceLine
;
hres
=
enumLineNumbers
->
Item
(
0
,
&
sourceLine
);
if
(
S_OK
!=
hres
)
throw
DiaException
(
L"failed to find source line"
);
DiaSourceFilePtr
sourceFile
;
hres
=
sourceLine
->
get_sourceFile
(
&
sourceFile
);
if
(
S_OK
!=
hres
)
throw
DiaException
(
L"failed to find source line"
);
autoBstr
fileNameBstr
;
hres
=
sourceFile
->
get_fileName
(
&
fileNameBstr
);
if
(
S_OK
!=
hres
)
throw
DiaException
(
L"failed to find source line"
);
fileName
=
_bstr_t
(
fileNameBstr
,
false
);
hres
=
sourceLine
->
get_lineNumber
(
&
lineNo
);
if
(
S_OK
!=
hres
)
throw
DiaException
(
L"failed to find source line"
);
}
//////////////////////////////////////////////////////////////////////////////
std
::
wstring
DiaSession
::
getScopeName
(
IDiaSession
*
session
,
IDiaSymbol
*
globalScope
)
{
std
::
wstring
scopeName
;
...
...
@@ -847,7 +902,7 @@ void DiaSession::getSourceLine( ULONG64 offset, std::wstring &fileName, ULONG &l
throw
DiaException
(
L"failed to find source line"
);
fileName
=
_bstr_t
(
fileNameBstr
,
false
);
hres
=
sourceLine
->
get_lineNumber
(
&
lineNo
);
hres
=
sourceLine
->
get_lineNumber
(
&
lineNo
);
if
(
S_OK
!=
hres
)
throw
DiaException
(
L"failed to find source line"
);
...
...
kdlib/source/dia/diawrapper.h
View file @
16d787b4
...
...
@@ -59,105 +59,105 @@ public:
static
SymbolPtr
fromGlobalScope
(
IDiaSymbol
*
_symbol
,
const
std
::
wstring
&
_scope
);
SymbolPtr
getChildByName
(
const
std
::
wstring
&
_name
);
ULONG
getRva
();
SymbolPtr
getChildByName
(
const
std
::
wstring
&
_name
)
override
;
ULONG
getRva
()
override
;
SymbolPtrList
findChildren
(
ULONG
symTag
,
const
std
::
wstring
&
name
=
L""
,
bool
caseSensitive
=
FALSE
);
SymbolPtrList
findChildrenByRVA
(
unsigned
long
symTag
,
unsigned
long
rva
);
)
override
;
size_t
getSize
()
;
SymbolPtrList
findChildrenByRVA
(
unsigned
long
symTag
,
unsigned
long
rva
)
override
;
std
::
wstring
getName
();
std
::
wstring
getScopeName
();
size_t
getSize
()
override
;
SymbolPtr
getType
();
std
::
wstring
getName
()
override
;
std
::
wstring
getScopeName
()
override
;
SymbolPtr
get
Index
Type
();
SymbolPtr
getType
()
override
;
Sym
Tags
getSymTag
()
;
Sym
bolPtr
getIndexType
()
override
;
ULONGLONG
getVa
()
;
SymTags
getSymTag
()
override
;
ULONG
getLocType
()
;
ULONG
LONG
getVa
()
override
;
LONG
get
Offset
()
;
U
LONG
get
LocType
()
override
;
size_t
getCount
()
;
LONG
getOffset
()
override
;
void
getValue
(
NumVariant
&
vtValue
)
;
size_t
getCount
()
override
;
bool
isBasicType
()
;
void
getValue
(
NumVariant
&
vtValue
)
override
;
bool
is
IndirectVirtualBaseClass
()
;
bool
is
BasicType
()
override
;
bool
isVirtualBaseClass
();
bool
is
Indirect
VirtualBaseClass
()
override
;
bool
isVirtual
()
;
bool
isVirtual
BaseClass
()
override
;
ULONG
getBaseType
()
;
bool
isVirtual
()
override
;
ULONG
getB
itPosition
()
;
ULONG
getB
aseType
()
override
;
ULONG
get
IndexId
()
;
ULONG
get
BitPosition
()
override
;
ULONG
getUdtKind
();
ULONG
getUdtKind
()
override
;
ULONG
getDataKind
();
ULONG
getDataKind
()
override
;
ULONG
getRegisterId
();
ULONG
getRegisterId
()
override
;
virtual
ULONG
getRegRealativeId
()
override
;
unsigned
long
getRegRealativeId
()
override
;
virtual
SymbolPtr
getObjectPointerType
()
override
;
SymbolPtr
getObjectPointerType
()
override
;
virtual
ULONG
getCallingConvention
()
override
;
ULONG
getCallingConvention
()
override
;
virtual
SymbolPtr
getClassParent
()
override
;
SymbolPtr
getClassParent
()
override
;
MachineTypes
getMachineType
()
{
MachineTypes
getMachineType
()
override
{
return
m_machineType
;
}
//SymbolPtr getChildByName(const std::string &_name);
size_t
getChildCount
(
ULONG
symTag
);
size_t
getChildCount
(
ULONG
symTag
)
override
;
size_t
getChildCount
()
{
size_t
getChildCount
()
override
{
return
getChildCount
(
SymTagNull
);
}
SymbolPtr
getChildByIndex
(
ULONG
symTag
,
ULONG
_index
);
SymbolPtr
getChildByIndex
(
ULONG
symTag
,
ULONG
_index
)
override
;
SymbolPtr
getChildByIndex
(
ULONG
_index
)
{
SymbolPtr
getChildByIndex
(
ULONG
_index
)
override
{
return
getChildByIndex
(
SymTagNull
,
_index
);
}
bool
isConstant
();
bool
isConstant
()
override
;
int
getVirtualBasePointerOffset
()
override
;
int
getVirtualBase
PointerOffset
()
;
ULONG
getVirtualBase
DispIndex
()
override
;
ULONG
getVirtualBaseDisp
Index
()
;
ULONG
getVirtualBaseDisp
Size
()
override
;
ULONG
getVirtual
BaseDispSize
()
;
SymbolPtr
getVirtual
TableShape
()
override
;
void
setLoadAddress
(
ULONGLONG
baseAddress
)
;
unsigned
long
getVirtualBaseOffset
()
override
;
SymbolPtr
getVirtualTableShape
()
;
SymbolPtr
List
findInlineFramesByVA
(
MEMOFFSET_64
va
)
override
;
unsigned
long
getVirtualBaseOffset
()
;
void
getInlineSourceLine
(
MEMOFFSET_64
,
std
::
wstring
&
fileName
,
unsigned
long
&
lineNo
)
override
;
public:
typedef
std
::
pair
<
ULONG
,
const
wchar_t
*>
ValueNameEntry
;
static
const
ValueNameEntry
basicTypeName
[];
static
const
size_t
cntBasicTypeName
;
static
std
::
string
getBasicTypeName
(
ULONG
basicType
);
//
static std::string getBasicTypeName( ULONG basicType );
protected:
...
...
kdlib/source/dia/symexport.cpp
View file @
16d787b4
...
...
@@ -257,6 +257,16 @@ class ExportSymbolBase : public Symbol
{
NOT_IMPLEMENTED
();
}
SymbolPtrList
findInlineFramesByVA
(
MEMOFFSET_64
va
)
override
{
NOT_IMPLEMENTED
();
}
void
getInlineSourceLine
(
MEMOFFSET_64
,
std
::
wstring
&
fileName
,
unsigned
long
&
lineNo
)
override
{
NOT_IMPLEMENTED
();
}
};
///////////////////////////////////////////////////////////////////////////////
...
...
kdlib/source/net/netobject.h
View file @
16d787b4
...
...
@@ -27,147 +27,192 @@ public:
protected:
std
::
wstring
str
()
{
std
::
wstring
str
()
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
VarStorage
getStorage
()
const
{
VarStorage
getStorage
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
std
::
wstring
getRegisterName
()
const
{
std
::
wstring
getRegisterName
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
MEMOFFSET_64
getAddress
()
const
{
MEMOFFSET_64
getAddress
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
MEMOFFSET_64
getDebugStart
()
const
{
MEMOFFSET_64
getDebugStart
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
MEMOFFSET_64
getDebugEnd
()
const
{
MEMOFFSET_64
getDebugEnd
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
size_t
getSize
()
const
{
size_t
getSize
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
std
::
wstring
getName
()
const
{
std
::
wstring
getName
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedVarPtr
getElement
(
const
std
::
wstring
&
fieldName
)
{
TypedVarPtr
getElement
(
const
std
::
wstring
&
fieldName
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedVarPtr
getElement
(
size_t
index
)
{
TypedVarPtr
getElement
(
size_t
index
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
VarStorage
getElementStorage
(
const
std
::
wstring
&
fieldName
)
{
VarStorage
getElementStorage
(
const
std
::
wstring
&
fieldName
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
VarStorage
getElementStorage
(
size_t
index
)
{
VarStorage
getElementStorage
(
size_t
index
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
MEMOFFSET_REL
getElementOffset
(
const
std
::
wstring
&
fieldName
)
{
MEMOFFSET_REL
getElementOffset
(
const
std
::
wstring
&
fieldName
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
MEMOFFSET_REL
getElementOffset
(
size_t
index
)
{
MEMOFFSET_REL
getElementOffset
(
size_t
index
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
RELREG_ID
getElementOffsetRelativeReg
(
const
std
::
wstring
&
fieldName
)
{
RELREG_ID
getElementOffsetRelativeReg
(
const
std
::
wstring
&
fieldName
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
RELREG_ID
getElementOffsetRelativeReg
(
size_t
index
)
{
RELREG_ID
getElementOffsetRelativeReg
(
size_t
index
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
unsigned
long
getElementReg
(
const
std
::
wstring
&
fieldName
)
{
unsigned
long
getElementReg
(
const
std
::
wstring
&
fieldName
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
unsigned
long
getElementReg
(
size_t
index
)
{
unsigned
long
getElementReg
(
size_t
index
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
size_t
getElementCount
()
{
size_t
getElementCount
()
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
std
::
wstring
getElementName
(
size_t
index
)
{
std
::
wstring
getElementName
(
size_t
index
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
size_t
getElementIndex
(
const
std
::
wstring
&
elementName
)
{
size_t
getElementIndex
(
const
std
::
wstring
&
elementName
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedVarPtr
getMethod
(
const
std
::
wstring
&
name
,
const
std
::
wstring
&
prototype
=
L""
)
{
TypedVarPtr
getMethod
(
const
std
::
wstring
&
name
,
const
std
::
wstring
&
prototype
=
L""
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedVarPtr
getMethod
(
const
std
::
wstring
&
name
,
TypeInfoPtr
prototype
)
{
TypedVarPtr
getMethod
(
const
std
::
wstring
&
name
,
TypeInfoPtr
prototype
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypeInfoPtr
getType
()
const
{
TypeInfoPtr
getType
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
NumVariant
getValue
()
const
{
NumVariant
getValue
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
void
setValue
(
const
NumVariant
&
value
)
{
void
setValue
(
const
NumVariant
&
value
)
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
std
::
wstring
getStrValue
()
const
{
std
::
wstring
getStrValue
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
void
setStrValue
(
const
std
::
wstring
&
value
)
{
void
setStrValue
(
const
std
::
wstring
&
value
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
std
::
wstring
printValue
()
const
{
std
::
wstring
printValue
()
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedVarPtr
deref
()
{
TypedVarPtr
deref
()
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedVarPtr
castTo
(
const
std
::
wstring
&
typeName
)
const
{
TypedVarPtr
castTo
(
const
std
::
wstring
&
typeName
)
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedVarPtr
castTo
(
const
TypeInfoPtr
&
typeInfo
)
const
{
TypedVarPtr
castTo
(
const
TypeInfoPtr
&
typeInfo
)
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
void
writeBytes
(
const
DataAccessorPtr
&
stream
,
size_t
pos
=
0
)
const
{
void
writeBytes
(
const
DataAccessorPtr
&
stream
,
size_t
pos
=
0
)
const
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
TypedValue
call
(
const
TypedValueList
&
arglst
)
{
TypedValue
call
(
const
TypedValueList
&
arglst
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
void
setElement
(
const
std
::
wstring
&
fieldName
,
const
TypedValue
&
value
)
{
void
setElement
(
const
std
::
wstring
&
fieldName
,
const
TypedValue
&
value
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
virtual
void
setElement
(
size_t
index
,
const
TypedValue
&
value
)
{
void
setElement
(
size_t
index
,
const
TypedValue
&
value
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
TypedVarList
getInlineFunctions
(
MEMOFFSET_64
offset
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
void
getSourceLine
(
MEMOFFSET_64
offset
,
std
::
wstring
&
fileName
,
unsigned
long
&
lineno
)
override
{
throw
TypeException
(
L"Not applicable for managed objects"
);
}
...
...
kdlib/source/stack.cpp
View file @
16d787b4
#include "stdafx.h"
#include "kdlib\module.h"
#include "kdlib\dbgengine.h"
#include "stackimpl.h"
...
...
@@ -438,6 +439,55 @@ bool StackFrameImpl::findStaticVar(const std::wstring& varName)
/////////////////////////////////////////////////////////////////////////////
TypedVarPtr
StackFrameImpl
::
getFunction
()
{
auto
funcPtr
=
loadTypedVar
(
findSymbol
(
m_ip
));
if
(
m_inlineIndex
==
0
)
return
funcPtr
;
return
*
std
::
next
(
funcPtr
->
getInlineFunctions
(
m_ip
).
rbegin
(),
m_inlineIndex
-
1
);
}
/////////////////////////////////////////////////////////////////////////////
std
::
wstring
StackFrameImpl
::
getSymbol
(
bool
showDisplacement
)
{
if
(
m_inlineIndex
!=
0
)
{
auto
funcPtr
=
loadTypedVar
(
findSymbol
(
m_ip
));
return
(
*
std
::
next
(
funcPtr
->
getInlineFunctions
(
m_ip
).
rbegin
(),
m_inlineIndex
-
1
))
->
getName
();
}
if
(
!
showDisplacement
)
return
findSymbol
(
m_ip
);
MEMDISPLACEMENT
displacement
=
0
;
std
::
wstring
symbolName
=
findSymbol
(
m_ip
,
displacement
);
std
::
wstringstream
sstr
;
sstr
<<
symbolName
<<
'+'
<<
std
::
hex
<<
displacement
;
return
sstr
.
str
();