Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140103735
D35153.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D35153.diff
View Options
diff --git a/usr.bin/kdump/kdump.h b/usr.bin/kdump/kdump.h
--- a/usr.bin/kdump/kdump.h
+++ b/usr.bin/kdump/kdump.h
@@ -77,6 +77,7 @@
int value, int *rem);
#ifdef SYSDECODE_HAVE_LINUX
+bool ktrstruct_linux(const char *name, const char *data, size_t datalen);
void ktrsyscall_linux(struct ktr_syscall *ktr, register_t **resip,
int *resnarg, char *resc);
#ifdef __amd64__
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -2056,7 +2056,10 @@
ktrbitset(name, set, datalen);
free(set);
} else {
- printf("unknown structure\n");
+#ifdef SYSDECODE_HAVE_LINUX
+ if (ktrstruct_linux(name, data, datalen) == false)
+#endif
+ printf("unknown structure\n");
}
return;
invalid:
diff --git a/usr.bin/kdump/linux.c b/usr.bin/kdump/linux.c
--- a/usr.bin/kdump/linux.c
+++ b/usr.bin/kdump/linux.c
@@ -31,7 +31,11 @@
#include <sys/param.h>
#include <sys/uio.h>
#include <sys/ktrace.h>
+#include <err.h>
+#include <errno.h>
#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
#include <sysdecode.h>
#include "kdump.h"
@@ -45,6 +49,8 @@
#include <i386/linux/linux_syscall.h>
#endif
+#include <compat/linux/linux.h>
+
static void
print_linux_signal(int signo)
{
@@ -183,3 +189,41 @@
*resnarg = narg;
}
#endif /* __amd64__ */
+
+static void
+ktrsigset(const char *name, const l_sigset_t *mask, size_t sz)
+{
+ unsigned long i, c;
+
+ printf("%s [ ", name);
+ c = 0;
+ for (i = 1; i <= sz * CHAR_BIT; i++) {
+ if (!LINUX_SIGISMEMBER(*mask, i))
+ continue;
+ if (c != 0)
+ printf(", ");
+ printf("%s", sysdecode_linux_signal(i));
+ c++;
+ }
+ if (c == 0)
+ printf("empty ]\n");
+ else
+ printf(" ]\n");
+}
+
+bool
+ktrstruct_linux(const char *name, const char *data, size_t datalen)
+{
+ l_sigset_t mask;
+
+ if (strcmp(name, "l_sigset_t") == 0) {
+ /* Old Linux sigset_t is one word size. */
+ if (datalen < sizeof(int) || datalen > sizeof(l_sigset_t))
+ return (false);
+ memcpy(&mask, data, datalen);
+ ktrsigset(name, &mask, datalen);
+ } else
+ return (false);
+
+ return (true);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 21, 6:50 AM (1 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27109118
Default Alt Text
D35153.diff (2 KB)
Attached To
Mode
D35153: kdump: Decode sigset_t.
Attached
Detach File
Event Timeline
Log In to Comment