1.\" 2.\" Mach Operating System 3.\" Copyright (c) 1991,1990 Carnegie Mellon University 4.\" Copyright (c) 2007 Robert N. M. Watson 5.\" All Rights Reserved. 6.\" 7.\" Permission to use, copy, modify and distribute this software and its 8.\" documentation is hereby granted, provided that both the copyright 9.\" notice and this permission notice appear in all copies of the 10.\" software, derivative works or modified versions, and any portions 11.\" thereof, and that both notices appear in supporting documentation. 12.\" 13.\" CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" 14.\" CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR 15.\" ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. 16.\" 17.\" Carnegie Mellon requests users of this software to return to 18.\" 19.\" Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU 20.\" School of Computer Science 21.\" Carnegie Mellon University 22.\" Pittsburgh PA 15213-3890 23.\" 24.\" any improvements or extensions that they make and grant Carnegie Mellon 25.\" the rights to redistribute these changes. 26.\" 27.Dd November 10, 2022 28.Dt DDB 4 29.Os 30.Sh NAME 31.Nm ddb 32.Nd interactive kernel debugger 33.Sh SYNOPSIS 34In order to enable kernel debugging facilities include: 35.Bd -ragged -offset indent 36.Cd options KDB 37.Cd options DDB 38.Ed 39.Pp 40To prevent activation of the debugger on kernel 41.Xr panic 9 : 42.Bd -ragged -offset indent 43.Cd options KDB_UNATTENDED 44.Ed 45.Pp 46In order to print a stack trace of the current thread on the console 47for a panic: 48.Bd -ragged -offset indent 49.Cd options KDB_TRACE 50.Ed 51.Pp 52To print the numerical value of symbols in addition to the symbolic 53representation, define: 54.Bd -ragged -offset indent 55.Cd options DDB_NUMSYM 56.Ed 57.Pp 58To enable the 59.Xr gdb 4 60backend, so that remote debugging with 61.Xr kgdb 1 Pq Pa ports/devel/gdb 62is possible, include: 63.Bd -ragged -offset indent 64.Cd options GDB 65.Ed 66.Sh DESCRIPTION 67The 68.Nm 69kernel debugger is an interactive debugger with a syntax inspired by 70.Xr gdb 1 Pq Pa ports/devel/gdb . 71If linked into the running kernel, 72it can be invoked locally with the 73.Ql debug 74.Xr keymap 5 75action, usually mapped to Ctrl+Alt+Esc, or by setting the 76.Va debug.kdb.enter 77sysctl to 1. 78The debugger is also invoked on kernel 79.Xr panic 9 80if the 81.Va debug.debugger_on_panic 82.Xr sysctl 8 83MIB variable is set non-zero, 84which is the default 85unless the 86.Dv KDB_UNATTENDED 87option is specified. 88Similarly, if the 89.Va debug.debugger_on_recursive_panic 90variable is set to 91.Dv 1 , 92then the debugger will be invoked on a recursive kernel panic. 93This variable has a default value of 94.Dv 0 , 95and has no effect if 96.Va debug.debugger_on_panic 97is already set non-zero. 98.Pp 99The current location is called 100.Va dot . 101The 102.Va dot 103is displayed with 104a hexadecimal format at a prompt. 105The commands 106.Ic examine 107and 108.Ic write 109update 110.Va dot 111to the address of the last line 112examined or the last location modified, and set 113.Va next 114to the address of 115the next location to be examined or changed. 116Other commands do not change 117.Va dot , 118and set 119.Va next 120to be the same as 121.Va dot . 122.Pp 123The general command syntax is: 124.Ar command Ns Op Li / Ns Ar modifier 125.Oo Ar addr Oc Ns Op , Ns Ar count 126.Pp 127A blank line repeats the previous command from the address 128.Va next 129with 130count 1 and no modifiers. 131Specifying 132.Ar addr 133sets 134.Va dot 135to the address. 136Omitting 137.Ar addr 138uses 139.Va dot . 140A missing 141.Ar count 142is taken 143to be 1 for printing commands or infinity for stack traces. 144A 145.Ar count 146of -1 is equivalent to a missing 147.Ar count . 148Options that are supplied but not supported by the given 149.Ar command 150are usually ignored. 151.Pp 152The 153.Nm 154debugger has a pager feature (like the 155.Xr more 1 156command) 157for the output. 158If an output line exceeds the number set in the 159.Va lines 160variable, it displays 161.Dq Li --More-- 162and waits for a response. 163The valid responses for it are: 164.Pp 165.Bl -tag -compact -width ".Li SPC" 166.It Li SPC 167one more page 168.It Li RET 169one more line 170.It Li q 171abort the current command, and return to the command input mode 172.El 173.Pp 174Finally, 175.Nm 176provides a small (currently 10 items) command history, and offers 177simple 178.Nm emacs Ns -style 179command line editing capabilities. 180In addition to 181the 182.Nm emacs 183control keys, the usual ANSI arrow keys may be used to browse through the 184history buffer, and move the cursor within the current line. 185.Sh COMMANDS 186.Ss COMMON DEBUGGER COMMANDS 187.Bl -tag -width indent -compact 188.It Ic help 189Print a short summary of the available commands and command 190abbreviations. 191.Pp 192.It Xo 193.Ic examine Ns Op Li / Ns Cm AISabcdghilmorsuxz ... 194.Oo Ar addr Oc Ns Op , Ns Ar count 195.Xc 196.It Xo 197.Ic x Ns Op Li / Ns Cm AISabcdghilmorsuxz ... 198.Oo Ar addr Oc Ns Op , Ns Ar count 199.Xc 200Display the addressed locations according to the formats in the modifier. 201Multiple modifier formats display multiple locations. 202If no format is specified, the last format specified for this command 203is used. 204.Pp 205The format characters are: 206.Bl -tag -compact -width indent 207.It Cm b 208look at by bytes (8 bits) 209.It Cm h 210look at by half words (16 bits) 211.It Cm l 212look at by long words (32 bits) 213.It Cm g 214look at by quad words (64 bits) 215.It Cm a 216print the location being displayed 217.It Cm A 218print the location with a line number if possible 219.It Cm x 220display in unsigned hex 221.It Cm z 222display in signed hex 223.It Cm o 224display in unsigned octal 225.It Cm d 226display in signed decimal 227.It Cm u 228display in unsigned decimal 229.It Cm r 230display in current radix, signed 231.It Cm c 232display low 8 bits as a character. 233Non-printing characters are displayed as an octal escape code (e.g., 234.Ql \e000 ) . 235.It Cm s 236display the null-terminated string at the location. 237Non-printing characters are displayed as octal escapes. 238.It Cm m 239display in unsigned hex with character dump at the end of each line. 240The location is also displayed in hex at the beginning of each line. 241.It Cm i 242display as a disassembled instruction 243.It Cm I 244display as a disassembled instruction with possible alternate formats 245depending on the machine. 246On i386, this selects the alternate format for the instruction decoding 247(16 bits in a 32-bit code segment and vice versa). 248.It Cm S 249display a symbol name for the pointer stored at the address 250.El 251.Pp 252.It Ic xf 253Examine forward: 254execute an 255.Ic examine 256command with the last specified parameters to it 257except that the next address displayed by it is used as the start address. 258.Pp 259.It Ic xb 260Examine backward: 261execute an 262.Ic examine 263command with the last specified parameters to it 264except that the last start address subtracted by the size displayed by it 265is used as the start address. 266.Pp 267.It Ic print Ns Op Li / Ns Cm acdoruxz 268.It Ic p Ns Op Li / Ns Cm acdoruxz 269Print 270.Ar addr Ns s 271according to the modifier character (as described above for 272.Cm examine ) . 273Valid formats are: 274.Cm a , x , z , o , d , u , r , 275and 276.Cm c . 277If no modifier is specified, the last one specified to it is used. 278The argument 279.Ar addr 280can be a string, in which case it is printed as it is. 281For example: 282.Bd -literal -offset indent 283print/x "eax = " $eax "\enecx = " $ecx "\en" 284.Ed 285.Pp 286will print like: 287.Bd -literal -offset indent 288eax = xxxxxx 289ecx = yyyyyy 290.Ed 291.Pp 292.It Ic pprint Ns Oo Li / Ns Cm d depth Oc Oo Ar name Oc 293Pretty-print symbol specified by 294.Ar name 295using CTF debugging data. Works for all symbols exported by the kernel and loaded kernel modules. 296.Pp 297If the 298.Cm d 299modifier has been specified, contents of structs nested up to 300.Ar depth 301levels deep will also be included in the output. 302.Pp 303.It Ic pprint struct Ns Oo Li / Ns Cm d depth Ic Oc Oo Ar name Oc Ns Op Ns Ar addr 304Print memory at 305.Ar addr 306as struct 307.Ar name Ns . 308Works for all structs defined by the kernel and loaded kernel modules. 309.Pp 310If the 311.Cm d 312modifier has been specified, contents of structs nested up to 313.Ar depth 314levels deep will also be included in the output. 315.Pp 316.It Xo 317.Ic write Ns Op Li / Ns Cm bhl 318.Ar addr expr1 Op Ar expr2 ... 319.Xc 320.It Xo 321.Ic w Ns Op Li / Ns Cm bhl 322.Ar addr expr1 Op Ar expr2 ... 323.Xc 324Write the expressions specified after 325.Ar addr 326on the command line at succeeding locations starting with 327.Ar addr . 328The write unit size can be specified in the modifier with a letter 329.Cm b 330(byte), 331.Cm h 332(half word) or 333.Cm l 334(long word) respectively. 335If omitted, 336long word is assumed. 337.Pp 338.Sy Warning : 339since there is no delimiter between expressions, strange 340things may happen. 341It is best to enclose each expression in parentheses. 342.Pp 343.It Ic set Li $ Ns Ar variable Oo Li = Oc Ar expr 344Set the named variable or register with the value of 345.Ar expr . 346Valid variable names are described below. 347.Pp 348.It Ic break Ns Oo Li / Ns Cm u Oc Oo Ar addr Oc Ns Op , Ns Ar count 349.It Ic b Ns Oo Li / Ns Cm u Oc Oo Ar addr Oc Ns Op , Ns Ar count 350Set a break point at 351.Ar addr . 352If 353.Ar count 354is supplied, the 355.Ic continue 356command will not stop at this break point on the first 357.Ar count 358\- 1 times that it is hit. 359If the break point is set, a break point number is 360printed with 361.Ql # . 362This number can be used in deleting the break point 363or adding conditions to it. 364.Pp 365If the 366.Cm u 367modifier is specified, this command sets a break point in user 368address space. 369Without the 370.Cm u 371option, the address is considered to be in the kernel 372space, and a wrong space address is rejected with an error message. 373This modifier can be used only if it is supported by machine dependent 374routines. 375.Pp 376.Sy Warning : 377If a user text is shadowed by a normal user space debugger, 378user space break points may not work correctly. 379Setting a break 380point at the low-level code paths may also cause strange behavior. 381.Pp 382.It Ic delete Op Ar addr 383.It Ic d Op Ar addr 384.It Ic delete Li # Ns Ar number 385.It Ic d Li # Ns Ar number 386Delete the specified break point. 387The break point can be specified by a 388break point number with 389.Ql # , 390or by using the same 391.Ar addr 392specified in the original 393.Ic break 394command, or by omitting 395.Ar addr 396to get the default address of 397.Va dot . 398.Pp 399.It Ic halt 400Halt the system. 401.Pp 402.It Ic watch Oo Ar addr Oc Ns Op , Ns Ar size 403Set a watchpoint for a region. 404Execution stops when an attempt to modify the region occurs. 405The 406.Ar size 407argument defaults to 4. 408If you specify a wrong space address, the request is rejected 409with an error message. 410.Pp 411.Sy Warning : 412Attempts to watch wired kernel memory 413may cause unrecoverable error in some systems such as i386. 414Watchpoints on user addresses work best. 415.Pp 416.It Ic hwatch Oo Ar addr Oc Ns Op , Ns Ar size 417Set a hardware watchpoint for a region if supported by the 418architecture. 419Execution stops when an attempt to modify the region occurs. 420The 421.Ar size 422argument defaults to 4. 423.Pp 424.Sy Warning : 425The hardware debug facilities do not have a concept of separate 426address spaces like the watch command does. 427Use 428.Ic hwatch 429for setting watchpoints on kernel address locations only, and avoid 430its use on user mode address spaces. 431.Pp 432.It Ic dhwatch Oo Ar addr Oc Ns Op , Ns Ar size 433Delete specified hardware watchpoint. 434.Pp 435.It Ic kill Ar sig pid 436Send signal 437.Ar sig 438to process 439.Ar pid . 440The signal is acted on upon returning from the debugger. 441This command can be used to kill a process causing resource contention 442in the case of a hung system. 443See 444.Xr signal 3 445for a list of signals. 446Note that the arguments are reversed relative to 447.Xr kill 2 . 448.Pp 449.It Ic step Ns Oo Li / Ns Cm p Oc Ns Op , Ns Ar count 450.It Ic s Ns Oo Li / Ns Cm p Oc Ns Op , Ns Ar count 451Single step 452.Ar count 453times. 454If the 455.Cm p 456modifier is specified, print each instruction at each step. 457Otherwise, only print the last instruction. 458.Pp 459.Sy Warning : 460depending on machine type, it may not be possible to 461single-step through some low-level code paths or user space code. 462On machines with software-emulated single-stepping (e.g., pmax), 463stepping through code executed by interrupt handlers will probably 464do the wrong thing. 465.Pp 466.It Ic continue Ns Op Li / Ns Cm c 467.It Ic c Ns Op Li / Ns Cm c 468Continue execution until a breakpoint or watchpoint. 469If the 470.Cm c 471modifier is specified, count instructions while executing. 472Some machines (e.g., pmax) also count loads and stores. 473.Pp 474.Sy Warning : 475when counting, the debugger is really silently single-stepping. 476This means that single-stepping on low-level code may cause strange 477behavior. 478.Pp 479.It Ic until Ns Op Li / Ns Cm p 480Stop at the next call or return instruction. 481If the 482.Cm p 483modifier is specified, print the call nesting depth and the 484cumulative instruction count at each call or return. 485Otherwise, 486only print when the matching return is hit. 487.Pp 488.It Ic next Ns Op Li / Ns Cm p 489.It Ic match Ns Op Li / Ns Cm p 490Stop at the matching return instruction. 491If the 492.Cm p 493modifier is specified, print the call nesting depth and the 494cumulative instruction count at each call or return. 495Otherwise, only print when the matching return is hit. 496.Pp 497.It Xo 498.Ic trace Ns Op Li / Ns Cm u 499.Op Ar pid | tid Ns 500.Op , Ns Ar count 501.Xc 502.It Xo 503.Ic t Ns Op Li / Ns Cm u 504.Op Ar pid | tid Ns 505.Op , Ns Ar count 506.Xc 507.It Xo 508.Ic where Ns Op Li / Ns Cm u 509.Op Ar pid | tid Ns 510.Op , Ns Ar count 511.Xc 512.It Xo 513.Ic bt Ns Op Li / Ns Cm u 514.Op Ar pid | tid Ns 515.Op , Ns Ar count 516.Xc 517Stack trace. 518The 519.Cm u 520option traces user space; if omitted, 521.Ic trace 522only traces 523kernel space. 524The optional argument 525.Ar count 526is the number of frames to be traced. 527If 528.Ar count 529is omitted, all frames are printed. 530.Pp 531.Sy Warning : 532User space stack trace is valid 533only if the machine dependent code supports it. 534.Pp 535.It Xo 536.Ic search Ns Op Li / Ns Cm bhl 537.Ar addr 538.Ar value 539.Op Ar mask Ns 540.Op , Ns Ar count 541.Xc 542Search memory for 543.Ar value . 544The optional 545.Ar count 546argument limits the search. 547.\" 548.Pp 549.It Xo 550.Ic Ic reboot Ns Op Li / Ns Cm s 551.Op Ar seconds 552.Xc 553.It Xo 554.Ic Ic reset Ns Op Li / Ns Cm s 555.Op Ar seconds 556.Xc 557Hard reset the system. 558If the optional argument 559.Ar seconds 560is given, the debugger will wait for this long, at most a week, 561before rebooting. 562When the 563.Cm s 564modifier is given, the command will skip running any registered shutdown 565handlers and attempt the most basic reset. 566.Pp 567.It Ic thread Ar addr | tid 568Switch the debugger to the thread with ID 569.Ar tid , 570if the argument is a decimal number, or address 571.Ar addr , 572otherwise. 573.Pp 574.It Ic watchdog Op Ar exp 575Program the 576.Xr watchdog 4 577timer to fire in 578.Pf 2^ Ar exp 579seconds. 580If no argument is provided, the watchdog timer is disabled. 581.El 582.Ss SPECIALIZED HELPER COMMANDS 583.Bl -tag -width indent -compact 584.It Xo 585.Ic findstack 586.Ar addr 587.Xc 588Prints the address of the thread whose kernel-mode stack contains 589.Ar addr , 590if any. 591.Pp 592.It Ic show Cm active trace 593.It acttrace 594Show a stack trace for every thread running on a CPU. 595.Pp 596.It Ic show Cm all procs Ns Op Li / Ns Cm a 597.It Ic ps Ns Op Li / Ns Cm a 598Display all process information. 599The process information may not be shown if it is not 600supported in the machine, or the bottom of the stack of the 601target process is not in the main memory at that time. 602The 603.Cm a 604modifier will print command line arguments for each process. 605.\" 606.Pp 607.It Ic show Cm all trace 608.It Ic alltrace 609Show a stack trace for every thread in the system. 610.Pp 611.It Ic show Cm all ttys 612Show all TTY's within the system. 613Output is similar to 614.Xr pstat 8 , 615but also includes the address of the TTY structure. 616.\" 617.Pp 618.It Ic show Cm all vnets 619Show the same output as "show vnet" does, but lists all 620virtualized network stacks within the system. 621.\" 622.Pp 623.It Ic show Cm allchains 624Show the same information like "show lockchain" does, but 625for every thread in the system. 626.\" 627.Pp 628.It Ic show Cm alllocks 629Show all locks that are currently held. 630This command is only available if 631.Xr witness 4 632is included in the kernel. 633.\" 634.Pp 635.It Ic show Cm allpcpu 636The same as "show pcpu", but for every CPU present in the system. 637.\" 638.Pp 639.It Ic show Cm allrman 640Show information related with resource management, including 641interrupt request lines, DMA request lines, I/O ports, I/O memory 642addresses, and Resource IDs. 643.\" 644.Pp 645.It Ic show Cm apic 646Dump data about APIC IDT vector mappings. 647.\" 648.Pp 649.It Ic show Cm badstacks 650Walk the 651.Xr witness 4 652graph and print any lock-order violations. 653This command is only available if 654.Xr witness 4 655is included in the kernel. 656.\" 657.Pp 658.It Ic show Cm breaks 659Show breakpoints set with the "break" command. 660.\" 661.Pp 662.It Ic show Cm bio Ar addr 663Show information about the bio structure 664.Vt struct bio 665present at 666.Ar addr . 667See the 668.Pa sys/bio.h 669header file and 670.Xr g_bio 9 671for more details on the exact meaning of the structure fields. 672.\" 673.Pp 674.It Ic show Cm buffer Ar addr 675Show information about the buf structure 676.Vt struct buf 677present at 678.Ar addr . 679See the 680.Pa sys/buf.h 681header file for more details on the exact meaning of the structure fields. 682.\" 683.Pp 684.It Ic show Cm callout Ar addr 685Show information about the callout structure 686.Vt struct callout 687present at 688.Ar addr . 689.\" 690.Pp 691.It Ic show Cm cdev Op Ar addr 692Show the internal devfs state of the cdev structure located at 693.Ar addr . 694If no argument is provided, show the list of all created cdevs, consisting of 695the devfs node name and the 696.Vt struct cdev 697address. 698.\" 699.Pp 700.It Ic show Cm conifhk 701Lists hooks currently waiting for completion in 702.Fn run_interrupt_driven_config_hooks . 703.\" 704.Pp 705.It Ic show Cm cpusets 706Print numbered root and assigned CPU affinity sets. 707See 708.Xr cpuset 2 709for more details. 710.\" 711.Pp 712.It Ic show Cm cyrixreg 713Show registers specific to the Cyrix processor. 714.\" 715.Pp 716.It Ic show Cm devmap 717Prints the contents of the static device mapping table. 718Currently only available on the 719ARM 720architecture. 721.\" 722.Pp 723.It Ic show Cm domain Ar addr 724Print protocol domain structure 725.Vt struct domain 726at address 727.Ar addr . 728See the 729.Pa sys/domain.h 730header file for more details on the exact meaning of the structure fields. 731.\" 732.Pp 733.It Ic show Cm ffs Op Ar addr 734Show brief information about ffs mount at the address 735.Ar addr , 736if argument is given. 737Otherwise, provides the summary about each ffs mount. 738.\" 739.Pp 740.It Ic show Cm file Ar addr 741Show information about the file structure 742.Vt struct file 743present at address 744.Ar addr . 745.\" 746.Pp 747.It Ic show Cm files 748Show information about every file structure in the system. 749.\" 750.Pp 751.It Ic show Cm freepages 752Show the number of physical pages in each of the free lists. 753.\" 754.Pp 755.It Ic show Cm geom Op Ar addr 756If the 757.Ar addr 758argument is not given, displays the entire GEOM topology. 759If 760.Ar addr 761is given, displays details about the given GEOM object (class, geom, 762provider or consumer). 763.\" 764.Pp 765.It Ic show Cm idt 766Show IDT layout. 767The first column specifies the IDT vector. 768The second one is the name of the interrupt/trap handler. 769Those functions are machine dependent. 770.\" 771.Pp 772.It Ic show Cm igi_list Ar addr 773Show information about the IGMP structure 774.Vt struct igmp_ifsoftc 775present at 776.Ar addr . 777.\" 778.Pp 779.It Ic show Cm iosched Ar addr 780Show information about the I/O scheduler 781.Vt struct cam_iosched_softc 782located at 783.Ar addr . 784.\" 785.Pp 786.It Ic show Cm inodedeps Op Ar addr 787Show brief information about each inodedep structure. 788If 789.Ar addr 790is given, only inodedeps belonging to the fs located at the 791supplied address are shown. 792.\" 793.Pp 794.It Ic show Cm inpcb Ar addr 795Show information on IP Control Block 796.Vt struct in_pcb 797present at 798.Ar addr . 799.\" 800.Pp 801.It Ic show Cm intr 802Dump information about interrupt handlers. 803.\" 804.Pp 805.It Ic show Cm intrcnt 806Dump the interrupt statistics. 807.\" 808.Pp 809.It Ic show Cm irqs 810Show interrupt lines and their respective kernel threads. 811.\" 812.Pp 813.It Ic show Cm ktr Ns Op Li / Ns Cm a Ns Cm v Ns Cm V 814Print the contents of the 815.Xr ktr 4 816trace buffer. 817The 818.Cm v 819modifier will request fully verbose output, causing the file, line number, and 820timestamp to be printed for each trace entry. 821The 822.Cm V 823modifier will request only the timestamps to be printed. 824The 825.Cm a 826modifier will request that the output be unpaginated. 827.\" 828.Pp 829.It Ic show Cm lapic 830Show information from the local APIC registers for this CPU. 831.\" 832.Pp 833.It Ic show Cm lock Ar addr 834Show lock structure. 835The output format is as follows: 836.Bl -tag -width "flags" 837.It Ic class : 838Class of the lock. 839Possible types include 840.Xr mutex 9 , 841.Xr rmlock 9 , 842.Xr rwlock 9 , 843.Xr sx 9 . 844.It Ic name : 845Name of the lock. 846.It Ic flags : 847Flags passed to the lock initialization function. 848.Em flags 849values are lock class specific. 850.It Ic state : 851Current state of a lock. 852.Em state 853values are lock class specific. 854.It Ic owner : 855Lock owner. 856.El 857.\" 858.Pp 859.It Ic show Cm lockchain Ar addr 860Show all threads a particular thread at address 861.Ar addr 862is waiting on based on non-spin locks. 863.\" 864.Pp 865.It Ic show Cm lockedbufs 866Show the same information as "show buf", but for every locked 867.Vt struct buf 868object. 869.\" 870.Pp 871.It Ic show Cm lockedvnods 872List all locked vnodes in the system. 873.\" 874.Pp 875.It Ic show Cm locks 876Prints all locks that are currently acquired. 877This command is only available if 878.Xr witness 4 879is included in the kernel. 880.\" 881.Pp 882.It Ic show Cm locktree 883.\" 884.Pp 885.It Ic show Cm malloc Ns Op Li / Ns Cm i 886Prints 887.Xr malloc 9 888memory allocator statistics. 889If the 890.Cm i 891modifier is specified, format output as machine-parseable comma-separated 892values ("CSV"). 893The output columns are as follows: 894.Pp 895.Bl -tag -compact -offset indent -width "Requests" 896.It Ic Type 897Specifies a type of memory. 898It is the same as a description string used while defining the 899given memory type with 900.Xr MALLOC_DECLARE 9 . 901.It Ic InUse 902Number of memory allocations of the given type, for which 903.Xr free 9 904has not been called yet. 905.It Ic MemUse 906Total memory consumed by the given allocation type. 907.It Ic Requests 908Number of memory allocation requests for the given 909memory type. 910.El 911.Pp 912The same information can be gathered in userspace with 913.Dq Nm vmstat Fl m . 914.\" 915.Pp 916.It Ic show Cm map Ns Oo Li / Ns Cm f Oc Ar addr 917Prints the VM map at 918.Ar addr . 919If the 920.Cm f 921modifier is specified the 922complete map is printed. 923.\" 924.Pp 925.It Ic show Cm msgbuf 926Print the system's message buffer. 927It is the same output as in the 928.Dq Nm dmesg 929case. 930It is useful if you got a kernel panic, attached a serial cable 931to the machine and want to get the boot messages from before the 932system hang. 933.\" 934.Pp 935.It Ic show Cm mount Op Ar addr 936Displays details about the mount point located at 937.Ar addr . 938If no 939.Ar addr 940is specified, 941displays short info about all currently mounted file systems. 942.\" 943.Pp 944.It Ic show Cm object Ns Oo Li / Ns Cm f Oc Ar addr 945Prints the VM object at 946.Ar addr . 947If the 948.Cm f 949option is specified the 950complete object is printed. 951.\" 952.Pp 953.It Ic show Cm panic 954Print the panic message if set. 955.\" 956.Pp 957.It Ic show Cm page 958Show statistics on VM pages. 959.\" 960.Pp 961.It Ic show Cm pageq 962Show statistics on VM page queues. 963.\" 964.Pp 965.It Ic show Cm pciregs 966Print PCI bus registers. 967The same information can be gathered in userspace by running 968.Dq Nm pciconf Fl lv . 969.\" 970.Pp 971.It Ic show Cm pcpu 972Print current processor state. 973The output format is as follows: 974.Pp 975.Bl -tag -compact -offset indent -width "spin locks held:" 976.It Ic cpuid 977Processor identifier. 978.It Ic curthread 979Thread pointer, process identifier and the name of the process. 980.It Ic curpcb 981Control block pointer. 982.It Ic fpcurthread 983FPU thread pointer. 984.It Ic idlethread 985Idle thread pointer. 986.It Ic APIC ID 987CPU identifier coming from APIC. 988.It Ic currentldt 989LDT pointer. 990.It Ic spin locks held 991Names of spin locks held. 992.El 993.\" 994.Pp 995.It Ic show Cm pgrpdump 996Dump process groups present within the system. 997.\" 998.Pp 999.It Ic show Cm prison Op Ar addr 1000Show the prison structure located at 1001.Ar addr . 1002If no 1003.Ar addr 1004argument is specified, show information about all prisons in the system. 1005.\" 1006.Pp 1007.It Ic show Cm proc Op Ar addr 1008Show information about the process structure located at address 1009.Ar addr , 1010or the current process if no argument is specified. 1011.\" 1012.Pp 1013.It Ic show Cm procvm Op Ar addr 1014Show process virtual memory layout for the process located at 1015.Ar addr , 1016or the current process if no argument is specified. 1017.\" 1018.Pp 1019.It Ic show Cm protosw Ar addr 1020Print protocol switch structure 1021.Vt struct protosw 1022at address 1023.Ar addr . 1024.\" 1025.Pp 1026.It Ic show Cm registers Ns Op Li / Ns Cm u 1027Display the register set. 1028If the 1029.Cm u 1030modifier is specified, the register contents of the thread's previous 1031trapframe are displayed instead. 1032Usually, this corresponds to the saved state from userspace. 1033.\" 1034.Pp 1035.It Ic show Cm rman Ar addr 1036Show resource manager object 1037.Vt struct rman 1038at address 1039.Ar addr . 1040Addresses of particular pointers can be gathered with "show allrman" 1041command. 1042.\" 1043.Pp 1044.It Ic show Cm route Ar addr 1045Show route table result for destination 1046.Ar addr . 1047At this time, INET and INET6 formatted addresses are supported. 1048.\" 1049.Pp 1050.It Ic show Cm routetable Oo Ar af Oc 1051Show full route table or tables. 1052If 1053.Ar af 1054is specified, show only routes for the given numeric address family. 1055If no argument is specified, dump the route table for all address families. 1056.\" 1057.Pp 1058.It Ic show Cm rtc 1059Show real time clock value. 1060Useful for long debugging sessions. 1061.\" 1062.Pp 1063.It Ic show Cm sleepchain 1064Deprecated. 1065Now an alias for 1066.Ic show Cm lockchain . 1067.\" 1068.Pp 1069.It Ic show Cm sleepq Ar addr 1070.It Ic show Cm sleepqueue Ar addr 1071Show the 1072.Xr sleepqueue 9 1073structure located at 1074.Ar addr . 1075.\" 1076.Pp 1077.It Ic show Cm sockbuf Ar addr 1078Show the socket buffer 1079.Va struct sockbuf 1080located at 1081.Ar addr . 1082.\" 1083.Pp 1084.It Ic show Cm socket Ar addr 1085Show the socket object 1086.Vt struct socket 1087located at 1088.Ar addr . 1089.\" 1090.Pp 1091.It Ic show Cm sysregs 1092Show system registers (e.g., 1093.Li cr0-4 1094on i386.) 1095Not present on some platforms. 1096.\" 1097.Pp 1098.It Ic show Cm tcpcb Ar addr 1099Print TCP control block 1100.Vt struct tcpcb 1101lying at address 1102.Ar addr . 1103For exact interpretation of output, visit 1104.Pa netinet/tcp.h 1105header file. 1106.\" 1107.Pp 1108.It Ic show Cm thread Op Ar addr | tid 1109If no 1110.Ar addr 1111or 1112.Ar tid 1113is specified, show detailed information about current thread. 1114Otherwise, print information about the thread with ID 1115.Ar tid 1116or kernel address 1117.Ar addr . 1118(If the argument is a decimal number, it is assumed to be a tid.) 1119.\" 1120.Pp 1121.It Ic show Cm threads 1122Show all threads within the system. 1123Output format is as follows: 1124.Pp 1125.Bl -tag -compact -offset indent -width "Second column" 1126.It Ic First column 1127Thread identifier (TID) 1128.It Ic Second column 1129Thread structure address 1130.It Ic Third column 1131Backtrace. 1132.El 1133.\" 1134.Pp 1135.It Ic show Cm tty Ar addr 1136Display the contents of a TTY structure in a readable form. 1137.\" 1138.Pp 1139.It Ic show Cm turnstile Ar addr 1140Show turnstile 1141.Vt struct turnstile 1142structure at address 1143.Ar addr . 1144Turnstiles are structures used within the 1145.Fx 1146kernel to implement 1147synchronization primitives which, while holding a specific type of lock, cannot 1148sleep or context switch to another thread. 1149Currently, those are: 1150.Xr mutex 9 , 1151.Xr rwlock 9 , 1152.Xr rmlock 9 . 1153.\" 1154.Pp 1155.It Ic show Cm uma Ns Op Li / Ns Cm i 1156Show UMA allocator statistics. 1157If the 1158.Cm i 1159modifier is specified, format output as machine-parseable comma-separated 1160values ("CSV"). 1161The output contains the following columns: 1162.Pp 1163.Bl -tag -compact -offset indent -width "Total Mem" 1164.It Cm "Zone" 1165Name of the UMA zone. 1166The same string that was passed to 1167.Xr uma_zcreate 9 1168as a first argument. 1169.It Cm "Size" 1170Size of a given memory object (slab). 1171.It Cm "Used" 1172Number of slabs being currently used. 1173.It Cm "Free" 1174Number of free slabs within the UMA zone. 1175.It Cm "Requests" 1176Number of allocations requests to the given zone. 1177.It Cm "Total Mem" 1178Total memory in use (either allocated or free) by a zone, in bytes. 1179.It Cm "XFree" 1180Number of free slabs within the UMA zone that were freed on a different NUMA 1181domain than allocated. 1182(The count in the 1183.Cm "Free" 1184column is inclusive of 1185.Cm "XFree" . ) 1186.El 1187.Pp 1188The same information might be gathered in the userspace 1189with the help of 1190.Dq Nm vmstat Fl z . 1191.\" 1192.Pp 1193.It Ic show Cm unpcb Ar addr 1194Shows UNIX domain socket private control block 1195.Vt struct unpcb 1196present at the address 1197.Ar addr . 1198.\" 1199.Pp 1200.It Ic show Cm vmochk 1201Prints, whether the internal VM objects are in a map somewhere 1202and none have zero ref counts. 1203.\" 1204.Pp 1205.It Ic show Cm vmopag 1206Walk the list of VM objects in the system, printing the indices and physical 1207addresses of the VM pages belonging to each object. 1208.\" 1209.Pp 1210.It Ic show Cm vnet Ar addr 1211Prints virtualized network stack 1212.Vt struct vnet 1213structure present at the address 1214.Ar addr . 1215.\" 1216.Pp 1217.It Ic show Cm vnode Ar addr 1218Prints vnode 1219.Vt struct vnode 1220structure lying at 1221.Ar addr . 1222For the exact interpretation of the output, look at the 1223.Pa sys/vnode.h 1224header file. 1225.\" 1226.Pp 1227.It Ic show Cm vnodebufs Ar addr 1228Shows clean/dirty buffer lists of the vnode located at 1229.Ar addr . 1230.\" 1231.Pp 1232.It Ic show Cm vpath Ar addr 1233Walk the namecache to lookup the pathname of the vnode located at 1234.Ar addr . 1235.\" 1236.Pp 1237.It Ic show Cm watches 1238Displays all watchpoints. 1239Shows watchpoints set with "watch" command. 1240.\" 1241.Pp 1242.It Ic show Cm witness 1243Shows information about lock acquisition coming from the 1244.Xr witness 4 1245subsystem. 1246.El 1247.Ss OFFLINE DEBUGGING COMMANDS 1248.Bl -tag -width indent -compact 1249.It Ic dump 1250Initiate a kernel core dump to the device(s) configured by 1251.Xr dumpon 8 . 1252.Pp 1253.It Ic gdb 1254Switches to remote GDB mode. 1255In remote GDB mode, another machine is required that runs 1256.Xr gdb 1 Pq Pa ports/devel/gdb 1257using the remote debug feature, with a connection to the serial 1258console port on the target machine. 1259.Pp 1260.It Ic netdump Fl s Ar server Oo Fl g Ar gateway Fl c Ar client Fl i Ar iface Oc 1261Configure 1262.Xr netdump 4 1263with the provided parameters, and immediately perform a netdump. 1264.Pp 1265There are some known limitations. 1266Principally, 1267.Xr netdump 4 1268only supports IPv4 at this time. 1269The address arguments to the 1270.Ic netdump 1271command must be dotted decimal IPv4 addresses. 1272(Hostnames are not supported.) 1273At present, the command only works if the machine is in a panic state. 1274Finally, the 1275.Nm 1276.Ic netdump 1277command does not provide any way to configure compression or encryption. 1278.Pp 1279.It Ic netgdb Fl s Ar server Oo Fl g Ar gateway Fl c Ar client Fl i Ar iface Oc 1280Initiate a 1281.Xr netgdb 4 1282session with the provided parameters. 1283.Pp 1284.Ic netgdb 1285has identical limitations to 1286.Ic netdump . 1287.Pp 1288.It Ic capture on 1289.It Ic capture off 1290.It Ic capture reset 1291.It Ic capture status 1292.Nm 1293supports a basic output capture facility, which can be used to retrieve the 1294results of debugging commands from userspace using 1295.Xr sysctl 3 . 1296.Ic capture on 1297enables output capture; 1298.Ic capture off 1299disables capture. 1300.Ic capture reset 1301will clear the capture buffer and disable capture. 1302.Ic capture status 1303will report current buffer use, buffer size, and disposition of output 1304capture. 1305.Pp 1306Userspace processes may inspect and manage 1307.Nm 1308capture state using 1309.Xr sysctl 8 : 1310.Pp 1311.Va debug.ddb.capture.bufsize 1312may be used to query or set the current capture buffer size. 1313.Pp 1314.Va debug.ddb.capture.maxbufsize 1315may be used to query the compile-time limit on the capture buffer size. 1316.Pp 1317.Va debug.ddb.capture.bytes 1318may be used to query the number of bytes of output currently in the capture 1319buffer. 1320.Pp 1321.Va debug.ddb.capture.data 1322returns the contents of the buffer as a string to an appropriately privileged 1323process. 1324.Pp 1325This facility is particularly useful in concert with the scripting and 1326.Xr textdump 4 1327facilities, allowing scripted debugging output to be captured and 1328committed to disk as part of a textdump for later analysis. 1329The contents of the capture buffer may also be inspected in a kernel core dump 1330using 1331.Xr kgdb 1 Pq Pa ports/devel/gdb . 1332.Pp 1333.It Ic run 1334.It Ic script 1335.It Ic scripts 1336.It Ic unscript 1337Run, define, list, and delete scripts. 1338See the 1339.Sx SCRIPTING 1340section for more information on the scripting facility. 1341.Pp 1342.It Ic textdump dump 1343.It Ic textdump set 1344.It Ic textdump status 1345.It Ic textdump unset 1346Use the 1347.Ic textdump dump 1348command to immediately perform a textdump. 1349More information may be found in 1350.Xr textdump 4 . 1351The 1352.Ic textdump set 1353command may be used to force the next kernel core dump to be a textdump 1354rather than a traditional memory dump or minidump. 1355.Ic textdump status 1356reports whether a textdump has been scheduled. 1357.Ic textdump unset 1358cancels a request to perform a textdump as the next kernel core dump. 1359.El 1360.Sh VARIABLES 1361The debugger accesses registers and variables as 1362.Li $ Ns Ar name . 1363Register names are as in the 1364.Dq Ic show Cm registers 1365command. 1366Some variables are suffixed with numbers, and may have some modifier 1367following a colon immediately after the variable name. 1368For example, register variables can have a 1369.Cm u 1370modifier to indicate user register (e.g., 1371.Dq Li $eax:u ) . 1372.Pp 1373Built-in variables currently supported are: 1374.Pp 1375.Bl -tag -width ".Va tabstops" -compact 1376.It Va radix 1377Input and output radix. 1378.It Va maxoff 1379Addresses are printed as 1380.Dq Ar symbol Ns Li + Ns Ar offset 1381unless 1382.Ar offset 1383is greater than 1384.Va maxoff . 1385.It Va maxwidth 1386The width of the displayed line. 1387.It Va lines 1388The number of lines. 1389It is used by the built-in pager. 1390Setting it to 0 disables paging. 1391.It Va tabstops 1392Tab stop width. 1393.It Va work Ns Ar xx 1394Work variable; 1395.Ar xx 1396can take values from 0 to 31. 1397.El 1398.Sh EXPRESSIONS 1399Most expression operators in C are supported except 1400.Ql ~ , 1401.Ql ^ , 1402and unary 1403.Ql & . 1404Special rules in 1405.Nm 1406are: 1407.Bl -tag -width ".No Identifiers" 1408.It Identifiers 1409The name of a symbol is translated to the value of the symbol, which 1410is the address of the corresponding object. 1411.Ql \&. 1412and 1413.Ql \&: 1414can be used in the identifier. 1415If supported by an object format dependent routine, 1416.Sm off 1417.Oo Ar filename : Oc Ar func : lineno , 1418.Sm on 1419.Oo Ar filename : Oc Ns Ar variable , 1420and 1421.Oo Ar filename : Oc Ns Ar lineno 1422can be accepted as a symbol. 1423.It Numbers 1424Radix is determined by the first two letters: 1425.Ql 0x : 1426hex, 1427.Ql 0o : 1428octal, 1429.Ql 0t : 1430decimal; otherwise, follow current radix. 1431.It Li \&. 1432.Va dot 1433.It Li + 1434.Va next 1435.It Li .. 1436address of the start of the last line examined. 1437Unlike 1438.Va dot 1439or 1440.Va next , 1441this is only changed by 1442.Ic examine 1443or 1444.Ic write 1445command. 1446.It Li ' 1447last address explicitly specified. 1448.It Li $ Ns Ar variable 1449Translated to the value of the specified variable. 1450It may be followed by a 1451.Ql \&: 1452and modifiers as described above. 1453.It Ar a Ns Li # Ns Ar b 1454A binary operator which rounds up the left hand side to the next 1455multiple of right hand side. 1456.It Li * Ns Ar expr 1457Indirection. 1458It may be followed by a 1459.Ql \&: 1460and modifiers as described above. 1461.El 1462.Sh SCRIPTING 1463.Nm 1464supports a basic scripting facility to allow automating tasks or responses to 1465specific events. 1466Each script consists of a list of DDB commands to be executed sequentially, 1467and is assigned a unique name. 1468Certain script names have special meaning, and will be automatically run on 1469various 1470.Nm 1471events if scripts by those names have been defined. 1472.Pp 1473The 1474.Ic script 1475command may be used to define a script by name. 1476Scripts consist of a series of 1477.Nm 1478commands separated with the 1479.Ql \&; 1480character. 1481For example: 1482.Bd -literal -offset indent 1483script kdb.enter.panic=bt; show pcpu 1484script lockinfo=show alllocks; show lockedvnods 1485.Ed 1486.Pp 1487The 1488.Ic scripts 1489command lists currently defined scripts. 1490.Pp 1491The 1492.Ic run 1493command execute a script by name. 1494For example: 1495.Bd -literal -offset indent 1496run lockinfo 1497.Ed 1498.Pp 1499The 1500.Ic unscript 1501command may be used to delete a script by name. 1502For example: 1503.Bd -literal -offset indent 1504unscript kdb.enter.panic 1505.Ed 1506.Pp 1507These functions may also be performed from userspace using the 1508.Xr ddb 8 1509command. 1510.Pp 1511Certain scripts are run automatically, if defined, for specific 1512.Nm 1513events. 1514The follow scripts are run when various events occur: 1515.Bl -tag -width kdb.enter.powerfail 1516.It Va kdb.enter.acpi 1517The kernel debugger was entered as a result of an 1518.Xr acpi 4 1519event. 1520.It Va kdb.enter.bootflags 1521The kernel debugger was entered at boot as a result of the debugger boot 1522flag being set. 1523.It Va kdb.enter.break 1524The kernel debugger was entered as a result of a serial or console break. 1525.It Va kdb.enter.cam 1526The kernel debugger was entered as a result of a 1527.Xr CAM 4 1528event. 1529.It Va kdb.enter.mac 1530The kernel debugger was entered as a result of an assertion failure in the 1531.Xr mac_test 4 1532module of the 1533TrustedBSD MAC Framework. 1534.It Va kdb.enter.netgraph 1535The kernel debugger was entered as a result of a 1536.Xr netgraph 4 1537event. 1538.It Va kdb.enter.panic 1539.Xr panic 9 1540was called. 1541.It Va kdb.enter.powerpc 1542The kernel debugger was entered as a result of an unimplemented interrupt 1543type on the powerpc platform. 1544.It Va kdb.enter.sysctl 1545The kernel debugger was entered as a result of the 1546.Va debug.kdb.enter 1547sysctl being set. 1548.It Va kdb.enter.unionfs 1549The kernel debugger was entered as a result of an assertion failure in the 1550union file system. 1551.It Va kdb.enter.unknown 1552The kernel debugger was entered, but no reason has been set. 1553.It Va kdb.enter.vfslock 1554The kernel debugger was entered as a result of a VFS lock violation. 1555.It Va kdb.enter.watchdog 1556The kernel debugger was entered as a result of a watchdog firing. 1557.It Va kdb.enter.witness 1558The kernel debugger was entered as a result of a 1559.Xr witness 4 1560violation. 1561.El 1562.Pp 1563In the event that none of these scripts is found, 1564.Nm 1565will attempt to execute a default script: 1566.Bl -tag -width kdb.enter.powerfail 1567.It Va kdb.enter.default 1568The kernel debugger was entered, but a script exactly matching the reason for 1569entering was not defined. 1570This can be used as a catch-all to handle cases not specifically of interest; 1571for example, 1572.Va kdb.enter.witness 1573might be defined to have special handling, and 1574.Va kdb.enter.default 1575might be defined to simply panic and reboot. 1576.El 1577.Sh HINTS 1578On machines with an ISA expansion bus, a simple NMI generation card can be 1579constructed by connecting a push button between the A01 and B01 (CHCHK# and 1580GND) card fingers. 1581Momentarily shorting these two fingers together may cause the bridge chipset to 1582generate an NMI, which causes the kernel to pass control to 1583.Nm . 1584Some bridge chipsets do not generate a NMI on CHCHK#, so your mileage may vary. 1585The NMI allows one to break into the debugger on a wedged machine to 1586diagnose problems. 1587Other bus' bridge chipsets may be able to generate NMI using bus specific 1588methods. 1589There are many PCI and PCIe add-in cards which can generate NMI for 1590debugging. 1591Modern server systems typically use IPMI to generate signals to enter the 1592debugger. 1593The 1594.Va devel/ipmitool 1595port can be used to send the 1596.Cd chassis power diag 1597command which delivers an NMI to the processor. 1598Embedded systems often use JTAG for debugging, but rarely use it in 1599combination with 1600.Nm . 1601.Pp 1602Serial consoles can break to the debugger by sending a BREAK 1603condition on the serial line. 1604This requires a kernel built with 1605.Cd options BREAK_TO_DEBUGGER 1606is specified in the kernel. 1607Most terminal emulation programs can send a break sequence with a 1608special key sequence or menu selection. 1609Sending the break can be difficult or even happen spuriously in some setups. 1610An alternative method is to build a kernel with 1611.Cd options ALT_BREAK_TO_DEBUGGER 1612then the sequence of CR TILDE CTRL-B enters the debugger; 1613CR TILDE CTRL-P causes a panic; and 1614CR TILDE CTRL-R causes an immediate reboot. 1615In all these sequences, CR represents Carriage Return and is usually 1616sent by pressing the Enter or Return key. 1617TILDE is the ASCII tilde character (~). 1618CTRL-x is Control x, sent by pressing the Control key, then x, then releasing 1619both. 1620.Pp 1621The break-to-debugger behavior can be enabled by setting 1622.Xr sysctl 8 1623.Va debug.kdb.break_to_debugger 1624to 1. 1625The alt-break-to-debugger behavior can be enabled by setting 1626.Xr sysctl 8 1627.Va debug.kdb.alt_break_to_debugger 1628to 1. 1629The debugger can be entered by setting 1630.Xr sysctl 8 1631.Va debug.kdb.enter 1632to 1. 1633.Pp 1634Output can be interrupted, paused, and resumed with the control 1635characters CTRL-C, CTRL-S, and CTRL-Q. 1636Because these control characters are received as in-band data from the 1637console, there is an input buffer, and once that buffer fills 1638.Nm 1639must either stop responding to control characters or drop additional 1640input while continuing to search for control characters. 1641This behavior is controlled by the tunable 1642.Xr sysctl 8 1643.Va debug.ddb.prioritize_control_input , 1644which defaults to 1. 1645The input buffer size is 512 bytes. 1646.Sh FILES 1647Header files mentioned in this manual page can be found below 1648.Pa /usr/include 1649directory. 1650.Pp 1651.Bl -dash -compact 1652.It 1653.Pa sys/buf.h 1654.It 1655.Pa sys/domain.h 1656.It 1657.Pa netinet/in_pcb.h 1658.It 1659.Pa sys/socket.h 1660.It 1661.Pa sys/vnode.h 1662.El 1663.Sh SEE ALSO 1664.Xr gdb 1 Pq Pa ports/devel/gdb , 1665.Xr kgdb 1 Pq Pa ports/devel/gdb , 1666.Xr acpi 4 , 1667.Xr CAM 4 , 1668.Xr gdb 4 , 1669.Xr mac_ddb 4 , 1670.Xr mac_test 4 , 1671.Xr netgraph 4 , 1672.Xr textdump 4 , 1673.Xr witness 4 , 1674.Xr ddb 8 , 1675.Xr sysctl 8 , 1676.Xr panic 9 1677.Sh HISTORY 1678The 1679.Nm 1680debugger was developed for Mach, and ported to 1681.Bx 386 0.1 . 1682This manual page translated from 1683.Xr man 7 1684macros by 1685.An Garrett Wollman . 1686.Pp 1687.An Robert N. M. Watson 1688added support for 1689.Nm 1690output capture, 1691.Xr textdump 4 1692and scripting in 1693.Fx 7.1 . 1694