Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
K
kdlibcpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
kdlibcpp
kdlibcpp
Commits
3aab657b
Commit
3aab657b
authored
Mar 29, 2018
by
Aleksey R.
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix-scope-names' into 'dev-1.0'
module name as scope names for DiaSymbol See merge request
!7
parents
2616b468
0e4eed02
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
14 deletions
+23
-14
kdlib/source/dia/diawrapper.cpp
kdlib/source/dia/diawrapper.cpp
+17
-10
kdlib/source/dia/diawrapper.h
kdlib/source/dia/diawrapper.h
+6
-4
No files found.
kdlib/source/dia/diawrapper.cpp
View file @
3aab657b
...
...
@@ -177,14 +177,14 @@ std::wstring getBasicTypeName( ULONG basicType )
////////////////////////////////////////////////////////////////////////////////
DiaSymbol
::
DiaSymbol
(
DiaSymbolPtr
&
_symbol
,
DiaSymbolPtr
&
_scope
,
MachineTypes
machineType
)
DiaSymbol
::
DiaSymbol
(
DiaSymbolPtr
&
_symbol
,
const
std
::
wstring
&
_scope
,
MachineTypes
machineType
)
:
m_symbol
(
_symbol
),
m_scope
(
_scope
),
m_machineType
(
machineType
)
{
}
//////////////////////////////////////////////////////////////////////////////////
SymbolPtr
DiaSymbol
::
fromGlobalScope
(
IDiaSymbol
*
_symbol
)
SymbolPtr
DiaSymbol
::
fromGlobalScope
(
IDiaSymbol
*
_symbol
,
const
std
::
wstring
&
_scope
)
{
MachineTypes
machineType
;
HRESULT
hres
=
_symbol
->
get_machineType
(
(
DWORD
*
)
&
machineType
);
...
...
@@ -193,7 +193,7 @@ SymbolPtr DiaSymbol::fromGlobalScope( IDiaSymbol *_symbol )
if
(
!
machineType
)
machineType
=
machine_I386
;
return
SymbolPtr
(
new
DiaSymbol
(
DiaSymbolPtr
(
_symbol
),
DiaSymbolPtr
(
_symbol
),
machineType
)
);
return
SymbolPtr
(
new
DiaSymbol
(
DiaSymbolPtr
(
_symbol
),
_scope
,
machineType
)
);
}
//////////////////////////////////////////////////////////////////////////////////
...
...
@@ -562,12 +562,7 @@ std::wstring DiaSymbol::getName()
std
::
wstring
DiaSymbol
::
getScopeName
()
{
HRESULT
hres
;
BSTR
bstrName
=
NULL
;
hres
=
m_scope
->
get_name
(
&
bstrName
);
if
(
S_OK
==
hres
)
return
std
::
wstring
(
_bstr_t
(
bstrName
,
false
));
return
L""
;
return
m_scope
;
}
///////////////////////////////////////////////////////////////////////////////
...
...
@@ -770,6 +765,18 @@ unsigned long DiaSymbol::getVirtualBaseOffset()
//////////////////////////////////////////////////////////////////////////////
std
::
wstring
DiaSession
::
getScopeName
(
IDiaSession
*
session
)
{
ULONGLONG
loadBase
;
HRESULT
hres
=
session
->
get_loadAddress
(
&
loadBase
);
if
(
S_OK
!=
hres
)
return
L""
;
return
getModuleName
(
loadBase
);
}
//////////////////////////////////////////////////////////////////////////////
SymbolPtr
DiaSession
::
findByRva
(
ULONG
rva
,
ULONG
symTag
,
LONG
*
pdisplacement
)
{
DiaSymbolPtr
child
;
...
...
@@ -792,7 +799,7 @@ SymbolPtr DiaSession::findByRva( ULONG rva, ULONG symTag, LONG* pdisplacement )
if
(
pdisplacement
)
*
pdisplacement
=
displacement
;
return
SymbolPtr
(
new
DiaSymbol
(
child
,
m_globalScope
,
m_globalSymbol
->
getMachineType
()
)
);
return
SymbolPtr
(
new
DiaSymbol
(
child
,
getScopeName
(
m_session
)
,
m_globalSymbol
->
getMachineType
()
)
);
}
///////////////////////////////////////////////////////////////////////////////
...
...
kdlib/source/dia/diawrapper.h
View file @
3aab657b
...
...
@@ -55,9 +55,9 @@ private:
class
DiaSymbol
:
public
Symbol
{
public:
DiaSymbol
(
DiaSymbolPtr
&
_symbol
,
DiaSymbolPtr
&
_scope
,
MachineTypes
machineType
);
DiaSymbol
(
DiaSymbolPtr
&
_symbol
,
const
std
::
wstring
&
_scope
,
MachineTypes
machineType
);
static
SymbolPtr
fromGlobalScope
(
IDiaSymbol
*
_symbol
);
static
SymbolPtr
fromGlobalScope
(
IDiaSymbol
*
_symbol
,
const
std
::
wstring
&
_scope
);
SymbolPtr
getChildByName
(
const
std
::
wstring
&
_name
);
...
...
@@ -190,7 +190,7 @@ protected:
}
DiaSymbolPtr
m_symbol
;
DiaSymbolPtr
m_scope
;
std
::
wstring
m_scope
;
MachineTypes
m_machineType
;
};
...
...
@@ -203,7 +203,7 @@ public:
DiaSession
(
IDiaSession
*
session
,
IDiaSymbol
*
globalScope
,
const
std
::
wstring
symbolFile
)
:
m_globalScope
(
globalScope
),
m_globalSymbol
(
DiaSymbol
::
fromGlobalScope
(
globalScope
)
),
m_globalSymbol
(
DiaSymbol
::
fromGlobalScope
(
globalScope
,
getScopeName
(
session
)
)
),
m_session
(
session
),
m_symbolFileName
(
symbolFile
)
{}
...
...
@@ -222,6 +222,8 @@ public:
private:
static
std
::
wstring
getScopeName
(
IDiaSession
*
session
);
ULONG
findRvaByName
(
const
std
::
string
&
name
);
DiaSymbolPtr
m_globalScope
;
...
...
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