Simply bugfixes, see patch to debian/changelog for details

This commit is contained in:
Wichert Akkerman 1999-03-15 19:49:42 +00:00
parent 76baf7c9f6
commit 5daa028ca3
6 changed files with 26 additions and 88 deletions

15
mem.c
View File

@ -36,6 +36,7 @@
#else
#include <sys/mman.h>
#endif
#if defined(LINUX) && defined(__i386__)
#include <asm/ldt.h>
#endif
@ -47,7 +48,7 @@ struct tcb *tcp;
if (entering(tcp)) {
tprintf("%#lx", tcp->u_arg[0]);
}
#ifdef linux
#ifdef LINUX
return RVAL_HEX;
#else
return 0;
@ -111,23 +112,21 @@ sys_mmap(tcp)
struct tcb *tcp;
{
#ifdef LINUX
#if defined(ALPHA) || defined(sparc)
# if defined(ALPHA) || defined(sparc)
long *u_arg = tcp->u_arg;
#else /* !ALPHA */
# else /* !ALPHA */
long u_arg[6];
#endif /* !ALPHA */
# endif /* !ALPHA */
#else /* !LINUX */
long *u_arg = tcp->u_arg;
#endif /* !LINUX */
if (entering(tcp)) {
#ifdef LINUX
#if !defined(ALPHA) && !defined(__sparc__)
#if defined(LINUX) && !defined(ALPHA) && !defined(__sparc__)
if (umoven(tcp, tcp->u_arg[0], sizeof u_arg,
(char *) u_arg) == -1)
return 0;
#endif /* ALPHA/sparc */
#endif /* LINUX */
#endif /* LINUX && !ALPHA && !sparc */
/* addr */
tprintf("%#lx, ", u_arg[0]);

4
net.c
View File

@ -673,11 +673,9 @@ struct tcb *tcp;
else
tprintf("[%u, %u]", fds[0], fds[1]);
}
#else
#if defined(SPARC) || defined(SVR4)
#elif defined(SPARC) || defined(SVR4)
if (exiting(tcp))
tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
#endif
#endif
return 0;
}

68
proc.c
View File

@ -85,73 +85,6 @@ static struct xlat proc_run_flags[] = {
{ 0, NULL },
};
#if 0
static struct xlat proc_map_flags[] = {
{ MA_READ, "MA_READ" },
{ MA_WRITE, "MA_WRITE" },
{ MA_EXEC, "MA_EXEC" },
{ MA_SHARED, "MA_SHARED" },
{ MA_BREAK, "MA_BREAK" },
{ MA_STACK, "MA_STACK" },
{ 0, NULL },
};
static struct xlat proc_page_flags[] = {
{ PG_REFERENCED,"PG_REFERENCED" },
{ PG_MODIFIED, "PG_MODIFIED" },
{ PG_HWMAPPED, "PG_HWMAPPED" },
{ 0, NULL },
};
#ifdef SPARC
static struct xlat proc_regs[] = {
{ R_G0, "R_G0" },
{ R_G1, "R_G1" },
{ R_G2, "R_G2" },
{ R_G3, "R_G3" },
{ R_G4, "R_G4" },
{ R_G5, "R_G5" },
{ R_G6, "R_G6" },
{ R_G7, "R_G7" },
{ R_O0, "R_O0" },
{ R_O1, "R_O1" },
{ R_O2, "R_O2" },
{ R_O3, "R_O3" },
{ R_O4, "R_O4" },
{ R_O5, "R_O5" },
{ R_O6, "R_O6" },
{ R_O7, "R_O7" },
{ R_L0, "R_L0" },
{ R_L1, "R_L1" },
{ R_L2, "R_L2" },
{ R_L3, "R_L3" },
{ R_L4, "R_L4" },
{ R_L5, "R_L5" },
{ R_L6, "R_L6" },
{ R_L7, "R_L7" },
{ R_I0, "R_I0" },
{ R_I1, "R_I1" },
{ R_I2, "R_I2" },
{ R_I3, "R_I3" },
{ R_I4, "R_I4" },
{ R_I5, "R_I5" },
{ R_I6, "R_I6" },
{ R_I7, "R_I7" },
{ R_PSR, "R_PSR" },
{ R_PC, "R_PC" },
{ R_nPC, "R_nPC" },
{ R_Y, "R_Y" },
{ R_WIM, "R_WIM" },
{ R_TBR, "R_TBR" },
{ 0, NULL },
};
#endif /* SPARC */
#endif /* 0 */
int
proc_ioctl(tcp, code, arg)
struct tcb *tcp;
@ -250,3 +183,4 @@ int code, arg;
}
#endif /* SVR4 */

View File

@ -62,7 +62,7 @@
#define WCOREDUMP(status) ((status) & 0200)
#endif
/* WTA: this has `&& !defined(LINUXSPARC', this seems unneeded though? */
/* WTA: this has `&& !defined(LINUXSPARC)', this seems unneeded though? */
#if defined(HAVE_PRCTL)
static struct xlat prctl_options[] = {
#ifdef PR_MAXPROCS
@ -182,7 +182,7 @@ struct tcb *tcp;
return 0;
}
#ifndef LINUX
#if !defined(LINUX)
int
sys_getdomainname(tcp)
@ -937,7 +937,7 @@ internal_wait(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
/* WTA: fix bug with hanging children */
/* WTA: fix bug with hanging children */
if (!(tcp->u_arg[2] & WNOHANG) && tcp->nchildren > 0) {
/* There are traced children */
tcp->flags |= TCB_SUSPENDED;

View File

@ -210,13 +210,13 @@ sigset_t *mask;
strcpy(outstr, s);
s = outstr + strlen(outstr);
nsigs = 0;
for (i = 1; i <= nsignals; i++) {
for (i = 1; i < nsignals; i++) {
if (sigismember(mask, i) == 1)
nsigs++;
}
if (nsigs >= nsignals * 2 / 3) {
*s++ = '~';
for (i = 1; i <= nsignals; i++) {
for (i = 1; i < nsignals; i++) {
switch (sigismember(mask, i)) {
case 1:
sigdelset(mask, i);
@ -229,7 +229,7 @@ sigset_t *mask;
}
format = "%s";
*s++ = '[';
for (i = 1; i <= nsignals; i++) {
for (i = 1; i < nsignals; i++) {
if (sigismember(mask, i) == 1) {
sprintf(s, format, signalent[i] + 3); s += strlen(s);
format = " %s";

15
util.c
View File

@ -518,6 +518,7 @@ char *laddr;
#ifdef LINUX
int pid = tcp->pid;
int n, m;
int started = 0;
union {
long val;
char x[sizeof(long)];
@ -530,13 +531,15 @@ char *laddr;
errno = 0;
u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
if (errno) {
if (errno==EPERM || errno==EIO) {
if (started && (errno==EPERM || errno==EIO)) {
/* Ran into 'end of memory' - stupid "printpath" */
return 0;
}
/* But if not started, we had a bogus address. */
perror("ptrace: umoven");
return -1;
}
started = 1;
memcpy(laddr, &u.x[n], m = MIN(sizeof(long) - n, len));
addr += sizeof(long), laddr += m, len -= m;
}
@ -544,13 +547,14 @@ char *laddr;
errno = 0;
u.val = ptrace(PTRACE_PEEKDATA, pid, (char *) addr, 0);
if (errno) {
if (errno==EPERM || errno==EIO) {
if (started && (errno==EPERM || errno==EIO)) {
/* Ran into 'end of memory' - stupid "printpath" */
return 0;
}
perror("ptrace: umoven");
return -1;
}
started = 1;
memcpy(laddr, u.x, m = MIN(sizeof(long), len));
addr += sizeof(long), laddr += m, len -= m;
}
@ -642,6 +646,7 @@ char *laddr;
#ifdef SRVR4
return umoven(tcp, addr, len, laddr);
#else /* !SVR4 */
int started = 0;
int pid = tcp->pid;
int i, n, m;
union {
@ -656,13 +661,14 @@ char *laddr;
errno = 0;
u.val = ptrace(PTRACE_PEEKDATA, pid, (char *)addr, 0);
if (errno) {
if (errno==EPERM || errno==EIO) {
if (started && (errno==EPERM || errno==EIO)) {
/* Ran into 'end of memory' - stupid "printpath" */
return 0;
}
perror("umovestr");
return -1;
}
started = 1;
memcpy(laddr, &u.x[n], m = MIN(sizeof(long)-n,len));
while (n & (sizeof(long) - 1))
if (u.x[n++] == '\0')
@ -673,13 +679,14 @@ char *laddr;
errno = 0;
u.val = ptrace(PTRACE_PEEKDATA, pid, (char *)addr, 0);
if (errno) {
if (errno==EPERM || errno==EIO) {
if (started && (errno==EPERM || errno==EIO)) {
/* Ran into 'end of memory' - stupid "printpath" */
return 0;
}
perror("umovestr");
return -1;
}
started = 1;
memcpy(laddr, u.x, m = MIN(sizeof(long), len));
for (i = 0; i < sizeof(long); i++)
if (u.x[i] == '\0')