2008-08-06 Jan Kratochvil <jan.kratochvil@redhat.com>

Fix compiler warnings.
	* signal.c (sys_signal): Cast to SIG_* to the matching type LONG.
	* strace.c (trace): Variables PSR and PC are now signed.
	* syscall.c (syscall_enter): Variable RBS_END is now signed long.
	Remove/add the RBS_END casts appropriately.
	* util.c [IA64] (arg_setup): Variable BSP is now signed long.
	Remove/add the BSP casts appropriately.
	<ia32>: Initialize *STATE.
This commit is contained in:
Jan Kratochvil 2008-08-06 21:38:52 +00:00
parent 21aa995745
commit 1f942710a5
4 changed files with 22 additions and 16 deletions

View File

@ -1176,13 +1176,13 @@ struct tcb *tcp;
printsignal(tcp->u_arg[0]);
tprintf(", ");
switch (tcp->u_arg[1]) {
case (int) SIG_ERR:
case (long) SIG_ERR:
tprintf("SIG_ERR");
break;
case (int) SIG_DFL:
case (long) SIG_DFL:
tprintf("SIG_DFL");
break;
case (int) SIG_IGN:
case (long) SIG_IGN:
#ifndef USE_PROCFS
if (tcp->u_arg[0] == SIGTRAP) {
tcp->flags |= TCB_SIGTRAPPED;
@ -1204,11 +1204,11 @@ struct tcb *tcp;
}
else {
switch (tcp->u_rval) {
case (int) SIG_ERR:
case (long) SIG_ERR:
tcp->auxstr = "SIG_ERR"; break;
case (int) SIG_DFL:
case (long) SIG_DFL:
tcp->auxstr = "SIG_DFL"; break;
case (int) SIG_IGN:
case (long) SIG_IGN:
tcp->auxstr = "SIG_IGN"; break;
default:
tcp->auxstr = NULL;

View File

@ -2421,11 +2421,12 @@ Process %d attached (waiting for parent)\n",
}
if (!cflag
&& (qual_flags[WSTOPSIG(status)] & QUAL_SIGNAL)) {
unsigned long addr = 0, pc = 0;
unsigned long addr = 0;
long pc = 0;
#if defined(PT_CR_IPSR) && defined(PT_CR_IIP) && defined(PT_GETSIGINFO)
# define PSR_RI 41
struct siginfo si;
unsigned long psr;
long psr;
upeek(pid, PT_CR_IPSR, &psr);
upeek(pid, PT_CR_IIP, &pc);

View File

@ -1963,20 +1963,21 @@ struct tcb *tcp;
#elif defined (IA64)
{
if (!ia32) {
unsigned long *out0, *rbs_end, cfm, sof, sol, i;
unsigned long *out0, cfm, sof, sol, i;
long rbs_end;
/* be backwards compatible with kernel < 2.4.4... */
# ifndef PT_RBS_END
# define PT_RBS_END PT_AR_BSP
# endif
if (upeek(pid, PT_RBS_END, (long *) &rbs_end) < 0)
if (upeek(pid, PT_RBS_END, &rbs_end) < 0)
return -1;
if (upeek(pid, PT_CFM, (long *) &cfm) < 0)
return -1;
sof = (cfm >> 0) & 0x7f;
sol = (cfm >> 7) & 0x7f;
out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
out0 = ia64_rse_skip_regs((unsigned long *) rbs_end, -sof + sol);
if (tcp->scno >= 0 && tcp->scno < nsyscalls
&& sysent[tcp->scno].nargs != -1)

14
util.c
View File

@ -1300,21 +1300,25 @@ typedef unsigned long *arg_setup_state;
static int
arg_setup(struct tcb *tcp, arg_setup_state *state)
{
unsigned long *bsp, cfm, sof, sol;
unsigned long cfm, sof, sol;
long bsp;
if (ia32)
if (ia32) {
/* Satisfy a false GCC warning. */
*state = NULL;
return 0;
}
if (upeek(tcp->pid, PT_AR_BSP, (long *) &bsp) < 0)
if (upeek(tcp->pid, PT_AR_BSP, &bsp) < 0)
return -1;
if (upeek(tcp->pid, PT_CFM, (long *) &cfm) < 0)
return -1;
sof = (cfm >> 0) & 0x7f;
sol = (cfm >> 7) & 0x7f;
bsp = ia64_rse_skip_regs(bsp, -sof + sol);
bsp = (long) ia64_rse_skip_regs((unsigned long *) bsp, -sof + sol);
*state = bsp;
*state = (unsigned long *) bsp;
return 0;
}