Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Kirill Smelkov
bcc
Commits
89331046
Commit
89331046
authored
May 11, 2017
by
Brenden Blanco
Committed by
GitHub
May 11, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1168 from palmtenor/fixso
Fix bug when finding symbols for shared libraries
parents
fc4d4646
55ac9847
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
src/cc/bcc_syms.cc
src/cc/bcc_syms.cc
+9
-9
src/cc/syms.h
src/cc/syms.h
+2
-2
No files found.
src/cc/bcc_syms.cc
View file @
89331046
...
...
@@ -201,9 +201,10 @@ bool ProcSyms::resolve_addr(uint64_t addr, struct bcc_symbol *sym,
sym
->
offset
=
0x0
;
const
char
*
original_module
=
nullptr
;
uint64_t
offset
;
for
(
Module
&
mod
:
modules_
)
{
if
(
mod
.
contains
(
addr
))
{
bool
res
=
mod
.
find_addr
(
addr
,
sym
);
if
(
mod
.
contains
(
addr
,
offset
))
{
bool
res
=
mod
.
find_addr
(
offset
,
sym
);
if
(
demangle
)
{
if
(
sym
->
name
)
sym
->
demangle_name
=
...
...
@@ -295,11 +296,12 @@ void ProcSyms::Module::load_sym_table() {
std
::
sort
(
syms_
.
begin
(),
syms_
.
end
());
}
bool
ProcSyms
::
Module
::
contains
(
uint64_t
addr
)
const
{
for
(
const
auto
&
range
:
ranges_
)
{
if
(
addr
>=
range
.
start
&&
addr
<
range
.
end
)
bool
ProcSyms
::
Module
::
contains
(
uint64_t
addr
,
uint64_t
&
offset
)
const
{
for
(
const
auto
&
range
:
ranges_
)
if
(
addr
>=
range
.
start
&&
addr
<
range
.
end
)
{
offset
=
type_
==
ModuleType
::
SO
?
addr
-
range
.
start
:
addr
;
return
true
;
}
}
return
false
;
}
...
...
@@ -315,9 +317,7 @@ bool ProcSyms::Module::find_name(const char *symname, uint64_t *addr) {
return
false
;
}
bool
ProcSyms
::
Module
::
find_addr
(
uint64_t
addr
,
struct
bcc_symbol
*
sym
)
{
uint64_t
offset
=
type_
==
ModuleType
::
SO
?
(
addr
-
start
())
:
addr
;
bool
ProcSyms
::
Module
::
find_addr
(
uint64_t
offset
,
struct
bcc_symbol
*
sym
)
{
load_sym_table
();
sym
->
module
=
name_
.
c_str
();
...
...
src/cc/syms.h
View file @
89331046
...
...
@@ -136,9 +136,9 @@ class ProcSyms : SymbolCache {
std
::
vector
<
Symbol
>
syms_
;
void
load_sym_table
();
bool
contains
(
uint64_t
addr
)
const
;
bool
contains
(
uint64_t
addr
,
uint64_t
&
offset
)
const
;
uint64_t
start
()
const
{
return
ranges_
.
begin
()
->
start
;
}
bool
find_addr
(
uint64_t
addr
,
struct
bcc_symbol
*
sym
);
bool
find_addr
(
uint64_t
offset
,
struct
bcc_symbol
*
sym
);
bool
find_name
(
const
char
*
symname
,
uint64_t
*
addr
);
static
int
_add_symbol
(
const
char
*
symname
,
uint64_t
start
,
uint64_t
end
,
...
...
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