1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-26 16:18:31 +00:00

Correctly print signal mask, the bug was introduced by cut and paste

in last commit.
This commit is contained in:
David Xu 2003-07-07 12:12:33 +00:00
parent 247056ed2a
commit db6104d462
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117305
2 changed files with 40 additions and 22 deletions

View File

@ -167,19 +167,20 @@ dump_thread(int fd, pthread_t pthread, int long_version)
strcpy(s, "This is the initial thread\n"); strcpy(s, "This is the initial thread\n");
__sys_write(fd, s, strlen(s)); __sys_write(fd, s, strlen(s));
} }
snprintf(s, sizeof(s), "sigmask (hi) ");
__sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x ",
pthread->oldsigmask.__bits[i]);
__sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
__sys_write(fd, s, strlen(s));
/* Process according to thread state: */ /* Process according to thread state: */
switch (pthread->state) { switch (pthread->state) {
case PS_SIGWAIT: case PS_SIGWAIT:
snprintf(s, sizeof(s), "sigmask (hi) ");
__sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x ",
pthread->sigmask.__bits[i]);
__sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
__sys_write(fd, s, strlen(s));
snprintf(s, sizeof(s), "waitset (hi) "); snprintf(s, sizeof(s), "waitset (hi) ");
__sys_write(fd, s, strlen(s)); __sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) { for (i = _SIG_WORDS - 1; i >= 0; i--) {
@ -195,7 +196,15 @@ dump_thread(int fd, pthread_t pthread, int long_version)
* coded to dump information: * coded to dump information:
*/ */
default: default:
/* Nothing to do here. */ snprintf(s, sizeof(s), "sigmask (hi) ");
__sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x ",
pthread->sigmask.__bits[i]);
__sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
__sys_write(fd, s, strlen(s));
break; break;
} }
} }

View File

@ -167,19 +167,20 @@ dump_thread(int fd, pthread_t pthread, int long_version)
strcpy(s, "This is the initial thread\n"); strcpy(s, "This is the initial thread\n");
__sys_write(fd, s, strlen(s)); __sys_write(fd, s, strlen(s));
} }
snprintf(s, sizeof(s), "sigmask (hi) ");
__sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x ",
pthread->oldsigmask.__bits[i]);
__sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
__sys_write(fd, s, strlen(s));
/* Process according to thread state: */ /* Process according to thread state: */
switch (pthread->state) { switch (pthread->state) {
case PS_SIGWAIT: case PS_SIGWAIT:
snprintf(s, sizeof(s), "sigmask (hi) ");
__sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x ",
pthread->sigmask.__bits[i]);
__sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
__sys_write(fd, s, strlen(s));
snprintf(s, sizeof(s), "waitset (hi) "); snprintf(s, sizeof(s), "waitset (hi) ");
__sys_write(fd, s, strlen(s)); __sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) { for (i = _SIG_WORDS - 1; i >= 0; i--) {
@ -195,7 +196,15 @@ dump_thread(int fd, pthread_t pthread, int long_version)
* coded to dump information: * coded to dump information:
*/ */
default: default:
/* Nothing to do here. */ snprintf(s, sizeof(s), "sigmask (hi) ");
__sys_write(fd, s, strlen(s));
for (i = _SIG_WORDS - 1; i >= 0; i--) {
snprintf(s, sizeof(s), "%08x ",
pthread->sigmask.__bits[i]);
__sys_write(fd, s, strlen(s));
}
snprintf(s, sizeof(s), "(lo)\n");
__sys_write(fd, s, strlen(s));
break; break;
} }
} }