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
5f5e118d
Commit
5f5e118d
authored
Feb 01, 2019
by
Teng Qin
Committed by
GitHub
Feb 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2174 from antonblanchard/debuginfo_fix
Fix debuginfo search on Ubuntu
parents
e94833fd
9d5f9721
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
src/cc/bcc_elf.c
src/cc/bcc_elf.c
+16
-1
No files found.
src/cc/bcc_elf.c
View file @
5f5e118d
...
...
@@ -453,6 +453,21 @@ static int verify_checksum(const char *file, unsigned int crc) {
return
actual
==
crc
;
}
// Check if two filenames point to the same file, including hard or soft links.
static
bool
same_file
(
char
*
a
,
const
char
*
b
)
{
struct
stat
stat_a
,
stat_b
;
if
(
stat
(
a
,
&
stat_a
)
||
stat
(
b
,
&
stat_b
))
return
false
;
if
((
stat_a
.
st_dev
==
stat_b
.
st_dev
)
&&
(
stat_a
.
st_ino
==
stat_b
.
st_ino
))
return
true
;
else
return
false
;
}
static
char
*
find_debug_via_debuglink
(
Elf
*
e
,
const
char
*
binpath
,
int
check_crc
)
{
char
fullpath
[
PATH_MAX
];
...
...
@@ -473,7 +488,7 @@ static char *find_debug_via_debuglink(Elf *e, const char *binpath,
// and it might contain poorer symbols (e.g. stripped or partial symbols)
// than the external debuginfo that might be available elsewhere.
snprintf
(
fullpath
,
sizeof
(
fullpath
),
"%s/%s"
,
bindir
,
name
);
if
(
s
trcmp
(
fullpath
,
binpath
)
!=
0
&&
access
(
fullpath
,
F_OK
)
!=
-
1
)
{
if
(
s
ame_file
(
fullpath
,
binpath
)
!=
true
&&
access
(
fullpath
,
F_OK
)
!=
-
1
)
{
res
=
strdup
(
fullpath
);
goto
DONE
;
}
...
...
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