mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-16 22:58:02 +00:00
BUILD: tools: make resolve_sym_name() return a const
Originally it was made to return a void* because some comparisons in the code where it was used required a lot of casts. But now we don't need that anymore. And having it non-const breaks the build on NetBSD 9 as reported in issue #728. So let's switch to const and adjust debug.c to accomodate this.
This commit is contained in:
parent
4c442b08b3
commit
0c439d8956
@ -996,7 +996,7 @@ int dump_text_line(struct buffer *out, const char *buf, int bsize, int len,
|
|||||||
void dump_addr_and_bytes(struct buffer *buf, const char *pfx, const void *addr, int n);
|
void dump_addr_and_bytes(struct buffer *buf, const char *pfx, const void *addr, int n);
|
||||||
void dump_hex(struct buffer *out, const char *pfx, const void *buf, int len, int unsafe);
|
void dump_hex(struct buffer *out, const char *pfx, const void *buf, int len, int unsafe);
|
||||||
int may_access(const void *ptr);
|
int may_access(const void *ptr);
|
||||||
void *resolve_sym_name(struct buffer *buf, const char *pfx, void *addr);
|
const void *resolve_sym_name(struct buffer *buf, const char *pfx, void *addr);
|
||||||
const char *get_exec_path();
|
const char *get_exec_path();
|
||||||
|
|
||||||
#if defined(USE_BACKTRACE)
|
#if defined(USE_BACKTRACE)
|
||||||
|
@ -98,7 +98,7 @@ void ha_thread_dump(struct buffer *buf, int thr, int calling_tid)
|
|||||||
struct buffer bak;
|
struct buffer bak;
|
||||||
void *callers[100];
|
void *callers[100];
|
||||||
int j, nptrs;
|
int j, nptrs;
|
||||||
void *addr;
|
const void *addr;
|
||||||
int dump = 0;
|
int dump = 0;
|
||||||
|
|
||||||
nptrs = my_backtrace(callers, sizeof(callers)/sizeof(*callers));
|
nptrs = my_backtrace(callers, sizeof(callers)/sizeof(*callers));
|
||||||
|
@ -4426,7 +4426,7 @@ static int dladdr_and_size(const void *addr, Dl_info *dli, size_t *size)
|
|||||||
* The symbol's base address is returned, or NULL when unresolved, in order to
|
* The symbol's base address is returned, or NULL when unresolved, in order to
|
||||||
* allow the caller to match it against known ones.
|
* allow the caller to match it against known ones.
|
||||||
*/
|
*/
|
||||||
void *resolve_sym_name(struct buffer *buf, const char *pfx, void *addr)
|
const void *resolve_sym_name(struct buffer *buf, const char *pfx, void *addr)
|
||||||
{
|
{
|
||||||
const struct {
|
const struct {
|
||||||
const void *func;
|
const void *func;
|
||||||
|
Loading…
Reference in New Issue
Block a user