summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libthread_db/Makefile2
-rw-r--r--lib/libthread_db/arch/arm/libpthread_md.c6
-rw-r--r--lib/libthread_db/arch/ia64/libpthread_md.c10
-rw-r--r--lib/libthread_db/arch/powerpc/libpthread_md.c2
-rw-r--r--lib/libthread_db/arch/sparc64/libpthread_md.c10
-rw-r--r--lib/libthread_db/libpthread_db.c43
-rw-r--r--lib/libthread_db/libthr_db.c24
7 files changed, 50 insertions, 47 deletions
diff --git a/lib/libthread_db/Makefile b/lib/libthread_db/Makefile
index 8e16333..22868c3 100644
--- a/lib/libthread_db/Makefile
+++ b/lib/libthread_db/Makefile
@@ -9,7 +9,7 @@ SRCS+= libpthread_md.c
SRCS+= libpthread_db.c
SRCS+= libthr_db.c
INCS= thread_db.h
-WARNS?= 3
+WARNS?= 6
CFLAGS+=-I. -I${.CURDIR}
SYM_MAPS+=${.CURDIR}/Symbol.map
diff --git a/lib/libthread_db/arch/arm/libpthread_md.c b/lib/libthread_db/arch/arm/libpthread_md.c
index 74d21b4..6e4b2bd 100644
--- a/lib/libthread_db/arch/arm/libpthread_md.c
+++ b/lib/libthread_db/arch/arm/libpthread_md.c
@@ -85,7 +85,7 @@ pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
}
void
-pt_fpreg_to_ucontext(const struct fpreg *r, ucontext_t *uc)
+pt_fpreg_to_ucontext(const struct fpreg *r __unused, ucontext_t *uc)
{
mcontext_t *mc = &uc->uc_mcontext;
@@ -94,7 +94,7 @@ pt_fpreg_to_ucontext(const struct fpreg *r, ucontext_t *uc)
}
void
-pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
+pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r)
{
/* XXX */
@@ -107,7 +107,7 @@ pt_md_init(void)
}
int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
{
/* XXX */
diff --git a/lib/libthread_db/arch/ia64/libpthread_md.c b/lib/libthread_db/arch/ia64/libpthread_md.c
index 3e85102..f5f12d3 100644
--- a/lib/libthread_db/arch/ia64/libpthread_md.c
+++ b/lib/libthread_db/arch/ia64/libpthread_md.c
@@ -34,22 +34,22 @@ __FBSDID("$FreeBSD$");
#include "libpthread_db.h"
void
-pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc)
+pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused)
{
}
void
-pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
+pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused)
{
}
void
-pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc)
+pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused)
{
}
void
-pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
+pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused)
{
}
@@ -59,7 +59,7 @@ pt_md_init(void)
}
int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
{
return (0);
}
diff --git a/lib/libthread_db/arch/powerpc/libpthread_md.c b/lib/libthread_db/arch/powerpc/libpthread_md.c
index b5cccb5..fbe77f4 100644
--- a/lib/libthread_db/arch/powerpc/libpthread_md.c
+++ b/lib/libthread_db/arch/powerpc/libpthread_md.c
@@ -75,7 +75,7 @@ pt_md_init(void)
}
int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
{
/* XXX */
diff --git a/lib/libthread_db/arch/sparc64/libpthread_md.c b/lib/libthread_db/arch/sparc64/libpthread_md.c
index 3e85102..f5f12d3 100644
--- a/lib/libthread_db/arch/sparc64/libpthread_md.c
+++ b/lib/libthread_db/arch/sparc64/libpthread_md.c
@@ -34,22 +34,22 @@ __FBSDID("$FreeBSD$");
#include "libpthread_db.h"
void
-pt_reg_to_ucontext(const struct reg *r, ucontext_t *uc)
+pt_reg_to_ucontext(const struct reg *r __unused, ucontext_t *uc __unused)
{
}
void
-pt_ucontext_to_reg(const ucontext_t *uc, struct reg *r)
+pt_ucontext_to_reg(const ucontext_t *uc __unused, struct reg *r __unused)
{
}
void
-pt_fpreg_to_ucontext(const struct fpreg* r, ucontext_t *uc)
+pt_fpreg_to_ucontext(const struct fpreg* r __unused, ucontext_t *uc __unused)
{
}
void
-pt_ucontext_to_fpreg(const ucontext_t *uc, struct fpreg *r)
+pt_ucontext_to_fpreg(const ucontext_t *uc __unused, struct fpreg *r __unused)
{
}
@@ -59,7 +59,7 @@ pt_md_init(void)
}
int
-pt_reg_sstep(struct reg *reg, int step)
+pt_reg_sstep(struct reg *reg __unused, int step __unused)
{
return (0);
}
diff --git a/lib/libthread_db/libpthread_db.c b/lib/libthread_db/libpthread_db.c
index 2757dfb..74394d2 100644
--- a/lib/libthread_db/libpthread_db.c
+++ b/lib/libthread_db/libpthread_db.c
@@ -346,11 +346,9 @@ pt_ta_map_lwp2thr(const td_thragent_t *ta, lwpid_t lwp, td_thrhandle_t *th)
}
static td_err_e
-pt_ta_thr_iter(const td_thragent_t *ta,
- td_thr_iter_f *callback, void *cbdata_p,
- td_thr_state_e state, int ti_pri,
- sigset_t *ti_sigmask_p,
- unsigned int ti_user_flags)
+pt_ta_thr_iter(const td_thragent_t *ta, td_thr_iter_f *callback,
+ void *cbdata_p, td_thr_state_e state __unused, int ti_pri __unused,
+ sigset_t *ti_sigmask_p __unused, unsigned int ti_user_flags __unused)
{
TAILQ_HEAD(, pthread) thread_list;
td_thrhandle_t th;
@@ -394,7 +392,7 @@ pt_ta_thr_iter(const td_thragent_t *ta,
static td_err_e
pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg)
{
- char *keytable;
+ void *keytable;
void *destructor;
int i, ret, allocated;
@@ -410,10 +408,10 @@ pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg)
return (P2T(ret));
}
for (i = 0; i < ta->thread_max_keys; i++) {
- allocated = *(int *)(keytable + i * ta->thread_size_key +
- ta->thread_off_key_allocated);
- destructor = *(void **)(keytable + i * ta->thread_size_key +
- ta->thread_off_key_destructor);
+ allocated = *(int *)(void *)((uintptr_t)keytable +
+ i * ta->thread_size_key + ta->thread_off_key_allocated);
+ destructor = *(void **)(void *)((uintptr_t)keytable +
+ i * ta->thread_size_key + ta->thread_off_key_destructor);
if (allocated) {
ret = (ki)(i, destructor, arg);
if (ret != 0) {
@@ -427,28 +425,32 @@ pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg)
}
static td_err_e
-pt_ta_event_addr(const td_thragent_t *ta, td_event_e event, td_notify_t *ptr)
+pt_ta_event_addr(const td_thragent_t *ta __unused, td_event_e event __unused,
+ td_notify_t *ptr __unused)
{
TDBG_FUNC();
return (TD_ERR);
}
static td_err_e
-pt_ta_set_event(const td_thragent_t *ta, td_thr_events_t *events)
+pt_ta_set_event(const td_thragent_t *ta __unused,
+ td_thr_events_t *events __unused)
{
TDBG_FUNC();
return (0);
}
static td_err_e
-pt_ta_clear_event(const td_thragent_t *ta, td_thr_events_t *events)
+pt_ta_clear_event(const td_thragent_t *ta __unused,
+ td_thr_events_t *events __unused)
{
TDBG_FUNC();
return (0);
}
static td_err_e
-pt_ta_event_getmsg(const td_thragent_t *ta, td_event_msg_t *msg)
+pt_ta_event_getmsg(const td_thragent_t *ta __unused,
+ td_event_msg_t *msg __unused)
{
TDBG_FUNC();
return (TD_NOMSG);
@@ -457,7 +459,7 @@ pt_ta_event_getmsg(const td_thragent_t *ta, td_event_msg_t *msg)
static td_err_e
pt_dbsuspend(const td_thrhandle_t *th, int suspend)
{
- td_thragent_t *ta = (td_thragent_t *)th->th_ta;
+ const td_thragent_t *ta = th->th_ta;
psaddr_t tcb_addr, tmbx_addr, ptr;
lwpid_t lwp;
uint32_t dflags;
@@ -951,28 +953,31 @@ pt_thr_setgregs(const td_thrhandle_t *th, const prgregset_t gregs)
}
static td_err_e
-pt_thr_event_enable(const td_thrhandle_t *th, int en)
+pt_thr_event_enable(const td_thrhandle_t *th __unused, int en __unused)
{
TDBG_FUNC();
return (0);
}
static td_err_e
-pt_thr_set_event(const td_thrhandle_t *th, td_thr_events_t *setp)
+pt_thr_set_event(const td_thrhandle_t *th __unused,
+ td_thr_events_t *setp __unused)
{
TDBG_FUNC();
return (0);
}
static td_err_e
-pt_thr_clear_event(const td_thrhandle_t *th, td_thr_events_t *setp)
+pt_thr_clear_event(const td_thrhandle_t *th __unused,
+ td_thr_events_t *setp __unused)
{
TDBG_FUNC();
return (0);
}
static td_err_e
-pt_thr_event_getmsg(const td_thrhandle_t *th, td_event_msg_t *msg)
+pt_thr_event_getmsg(const td_thrhandle_t *th __unused,
+ td_event_msg_t *msg __unused)
{
TDBG_FUNC();
return (TD_NOMSG);
diff --git a/lib/libthread_db/libthr_db.c b/lib/libthread_db/libthr_db.c
index bb5b46d..cdf2257 100644
--- a/lib/libthread_db/libthr_db.c
+++ b/lib/libthread_db/libthr_db.c
@@ -245,11 +245,9 @@ pt_ta_map_lwp2thr(const td_thragent_t *ta, lwpid_t lwp, td_thrhandle_t *th)
}
static td_err_e
-pt_ta_thr_iter(const td_thragent_t *ta,
- td_thr_iter_f *callback, void *cbdata_p,
- td_thr_state_e state, int ti_pri,
- sigset_t *ti_sigmask_p,
- unsigned int ti_user_flags)
+pt_ta_thr_iter(const td_thragent_t *ta, td_thr_iter_f *callback,
+ void *cbdata_p, td_thr_state_e state __unused, int ti_pri __unused,
+ sigset_t *ti_sigmask_p __unused, unsigned int ti_user_flags __unused)
{
TAILQ_HEAD(, pthread) thread_list;
td_thrhandle_t th;
@@ -288,7 +286,7 @@ pt_ta_thr_iter(const td_thragent_t *ta,
static td_err_e
pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg)
{
- char *keytable;
+ void *keytable;
void *destructor;
int i, ret, allocated;
@@ -304,10 +302,10 @@ pt_ta_tsd_iter(const td_thragent_t *ta, td_key_iter_f *ki, void *arg)
return (P2T(ret));
}
for (i = 0; i < ta->thread_max_keys; i++) {
- allocated = *(int *)(keytable + i * ta->thread_size_key +
- ta->thread_off_key_allocated);
- destructor = *(void **)(keytable + i * ta->thread_size_key +
- ta->thread_off_key_destructor);
+ allocated = *(int *)(void *)((uintptr_t)keytable +
+ i * ta->thread_size_key + ta->thread_off_key_allocated);
+ destructor = *(void **)(void *)((uintptr_t)keytable +
+ i * ta->thread_size_key + ta->thread_off_key_destructor);
if (allocated) {
ret = (ki)(i, destructor, arg);
if (ret != 0) {
@@ -422,7 +420,7 @@ pt_ta_event_getmsg(const td_thragent_t *ta, td_event_msg_t *msg)
static td_err_e
pt_dbsuspend(const td_thrhandle_t *th, int suspend)
{
- td_thragent_t *ta = (td_thragent_t *)th->th_ta;
+ const td_thragent_t *ta = th->th_ta;
int ret;
TDBG_FUNC();
@@ -662,7 +660,7 @@ static td_err_e
pt_thr_event_getmsg(const td_thrhandle_t *th, td_event_msg_t *msg)
{
static td_thrhandle_t handle;
- td_thragent_t *ta = (td_thragent_t *)th->th_ta;
+ const td_thragent_t *ta = th->th_ta;
psaddr_t pt, pt_temp;
long lwp;
int ret;
@@ -703,7 +701,7 @@ pt_thr_event_getmsg(const td_thrhandle_t *th, td_event_msg_t *msg)
}
static td_err_e
-pt_thr_sstep(const td_thrhandle_t *th, int step)
+pt_thr_sstep(const td_thrhandle_t *th, int step __unused)
{
TDBG_FUNC();
OpenPOWER on IntegriCloud