Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
4ef7737d
Commit
4ef7737d
authored
May 29, 2024
by
Dave Gosselin
Committed by
Dave Gosselin
Sep 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-33616 Show correct function names in safemalloc backtrace
Fix safemalloc's backtrace functionality to work on macOS.
parent
450040e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
mysys/safemalloc.c
mysys/safemalloc.c
+17
-1
No files found.
mysys/safemalloc.c
View file @
4ef7737d
...
@@ -224,6 +224,11 @@ static void print_stack(void **frame)
...
@@ -224,6 +224,11 @@ static void print_stack(void **frame)
{
{
const
char
*
err
;
const
char
*
err
;
int
i
;
int
i
;
#ifdef __APPLE__
char
**
strptr
=
0
;
#else
my_addr_loc
loc
;
#endif
if
((
err
=
my_addr_resolve_init
()))
if
((
err
=
my_addr_resolve_init
()))
{
{
...
@@ -231,18 +236,29 @@ static void print_stack(void **frame)
...
@@ -231,18 +236,29 @@ static void print_stack(void **frame)
return
;
return
;
}
}
#ifdef __APPLE__
for
(
i
=
0
;
i
<
SF_REMEMBER_FRAMES
&&
frame
[
i
];
i
++
);
strptr
=
backtrace_symbols
(
frame
,
i
);
#endif
for
(
i
=
0
;
i
<
SF_REMEMBER_FRAMES
&&
frame
[
i
];
i
++
)
for
(
i
=
0
;
i
<
SF_REMEMBER_FRAMES
&&
frame
[
i
];
i
++
)
{
{
my_addr_loc
loc
;
if
(
i
)
if
(
i
)
fprintf
(
stderr
,
", "
);
fprintf
(
stderr
,
", "
);
#ifdef __APPLE__
fprintf
(
stderr
,
"%s"
,
strptr
[
i
]);
#else
if
(
my_addr_resolve
(
frame
[
i
],
&
loc
))
if
(
my_addr_resolve
(
frame
[
i
],
&
loc
))
fprintf
(
stderr
,
"%p"
,
frame
[
i
]);
fprintf
(
stderr
,
"%p"
,
frame
[
i
]);
else
else
fprintf
(
stderr
,
"%s:%u"
,
loc
.
file
,
loc
.
line
);
fprintf
(
stderr
,
"%s:%u"
,
loc
.
file
,
loc
.
line
);
#endif
}
}
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
#ifdef __APPLE__
free
(
strptr
);
#endif
}
}
#else
#else
#define print_stack(X) fprintf(stderr, "???\n")
#define print_stack(X) fprintf(stderr, "???\n")
...
...
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