+|may disable coredumps by executing the "disablecore" macro. You can
+|optionally specify the filename to be used for the generated core file.
+end
+
+define sendsyslog
+ if $argc > 1
+ dumpinfoint KDP_DUMPINFO_SYSTEMLOG $arg1 $arg0
+ else
+ dumpinfoint KDP_DUMPINFO_SYSTEMLOG \0 $arg0
+ end
+end
+
+document sendsyslog
+Syntax: sendsyslog <IP address> [filename]
+|Configure the kernel to transmit a kernel system log to a server (kdumpd)
+|at the specified IP address. NOTE: You must issue a "continue"
+|command after using this macro to trigger the kernel system log. The kernel
+|will resume waiting in the debugger after completion. You can optionally
+|specify the name to be used for the generated system log.
+end
+
+define sendpaniclog
+ if panicstr
+ if $argc > 1
+ dumpinfoint KDP_DUMPINFO_PANICLOG $arg1 $arg0
+ else
+ dumpinfoint KDP_DUMPINFO_PANICLOG \0 $arg0
+ end
+ else
+ printf "No panic log available.\n"
+ end
+end
+
+document sendpaniclog
+Syntax: sendpaniclog <IP address> [filename]
+|Configure the kernel to transmit a kernel paniclog to a server (kdumpd)
+|at the specified IP address. NOTE: You must issue a "continue"
+|command after using this macro to trigger the kernel panic log. The kernel
+|will resume waiting in the debugger after completion. You can optionally
+|specify the name to be used for the generated panic log.
+end
+
+define getdumpinfo
+ dumpinfoint KDP_DUMPINFO_GETINFO
+ set $kgm_dumpinfo = (kdp_dumpinfo_reply_t *) manual_pkt.data
+ if $kgm_dumpinfo->type & KDP_DUMPINFO_REBOOT
+ printf "Sysem will reboot after kernel info gets dumped.\n"
+ else
+ printf "Sysem will not reboot after kernel info gets dumped.\n"
+ end
+ if $kgm_dumpinfo->type & KDP_DUMPINFO_NORESUME
+ printf "System will allow a re-attach after a KDP disconnect.\n"
+ else
+ printf "System will resume after a KDP disconnect.\n"
+ end
+ set $kgm_dumpinfo_type = $kgm_dumpinfo->type & KDP_DUMPINFO_MASK
+ if $kgm_dumpinfo_type == KDP_DUMPINFO_DISABLE
+ printf "Kernel not setup for remote dumps.\n"
+ else
+ printf "Remote dump type: "
+ if $kgm_dumpinfo_type == KDP_DUMPINFO_CORE
+ printf "Core file\n"
+ end
+ if $kgm_dumpinfo_type == KDP_DUMPINFO_PANICLOG
+ printf "Panic log\n"
+ end
+ if $kgm_dumpinfo_type == KDP_DUMPINFO_SYSTEMLOG
+ printf "System log\n"
+ end
+
+ printf "Name: "
+ if $kgm_dumpinfo->name[0] == '\0'
+ printf "(autogenerated)\n"
+ else
+ printf "%s\n", $kgm_dumpinfo->name
+ end
+
+ printf "Network Info: %s[%d] ", $kgm_dumpinfo->destip, $kgm_dumpinfo->port
+ if $kgm_dumpinfo->routerip[0] == '\0'
+ printf "\n"
+ else
+ printf "Router: %s\n", $kgm_dumpinfo->routerip
+ end
+ end
+end
+
+document getdumpinfo
+Syntax: getdumpinfo
+|Retrieve the current remote dump settings.
+end
+
+define setdumpinfo
+ dumpinfoint KDP_DUMPINFO_SETINFO $arg0 $arg1 $arg2 $arg3
+end
+
+document setdumpinfo
+Syntax: setdumpinfo <filename> <ip> <router> <port>
+|Configure the current remote dump settings. Specify \0 if you
+|want to use the defaults (filename) or previously configured
+|settings (ip/router). Specify 0 for the port if you wish to
+|use the previously configured/default setting for that.