summaryrefslogtreecommitdiff
path: root/sys/ddb
AgeCommit message (Collapse)Author
2021-11-16To debug IPsec and tdb refcounting it is useful to have "show tdb"Alexander Bluhm
and "show all tdbs" in ddb. tested by Hrvoje Popovski; OK mvs@
2021-10-27extend checks of ensuring there's valid CTF data before attempting to use it.Jasper Lievisse Adriaanse
2021-10-24use NULL not 0 for pointer values in kernJonathan Gray
ok semarie@
2021-09-03add kprobes provider for dtJasper Lievisse Adriaanse
this allows us to dynamically trace function boundaries with btrace by patching prologues and epilogues with a breakpoint upon which the handler records the data, sends it back to userland for btrace to consume. currently it's hidden behind DDBPROF, and there is still a lot to cleanup and improve, but basic scripts that observe return codes from a probed function work. from Tom Rollet, with various changes by me feedback and ok mpi@
2021-07-09fix scentence in db_printsym commentJasper Lievisse Adriaanse
2021-06-10Prevent interleaved stack traces in ddb from multiple CPUs. CheckAlexander Bluhm
atomically which CPU is currently tracing. OK cheloha@
2021-06-02kernel: introduce per-CPU panic(9) message bufferscheloha
Add a 512-byte buffer (ci_panicbuf) to each cpu_info struct on each platform for use by panic(9). The first panic on a given CPU writes its message to this buffer. Subsequent panics on a given CPU print the panic message to the console but do not modify the buffer. This aids debugging in two cases: - If 2+ CPUs panic simultaneously there is no risk of garbled messages in the panic buffer. - If a CPU panics and then the operator causes a second panic while using ddb(4), the operator can still recall the first failure on a particular CPU. Misc. changes to support this bigger change: - Set panicstr atomically to identify the first CPU to reach panic(). - Tweak db_show_panic_cmd() to print all panic messages across all CPUs. Prefix the first panic with an asterisk ('*'). - Prefer db_printf() to printf() during a panic if we have it. Apparently it disturbs less global state. - On amd64, tweak fault() to write the local panic buffer. This needs more work. Prompted by bluhm@ and deraadt@. Mostly written by deraadt@. Discussed with bluhm@, deraadt@ and kettenis@. Borne from a discussion on tech@ about making panic(9) more MP-safe: https://marc.info/?l=openbsd-tech&m=162086462316143&w=2 ok kettenis@, visa@, bluhm@, deraadt@
2021-03-12spellingJonathan Gray
2021-02-09ddb: when a new wsdisplay console attaches, resize ddb cols/rows to itJoshua Stein
ok visa
2021-01-09Finish converting ddb_sysctl to sysctl_int_boundedgnezdo
I missed the verbose pattern that it used for error checking the first time around. OK millert@
2020-12-10Convert ddb_sysctl to sysctl_bounded_arrgnezdo
ok gkoehler@
2020-10-26add a top-level "reboot" command, for people who keep forgetting "boot reboot"Theo de Raadt
ok kn
2020-10-15sick of the CMU, let's make this KNFTheo de Raadt
2020-05-26Stop requiring that .strtab has long alignment.gkoehler
When ddb loads symbols, the .strtab contains char strings and doesn't need long alignment. Our bootloader provides long alignment, but I started loading symbols on powerpc64 without our bootloader. ok mpi@ guenther@ kettenis@
2020-01-20Separate the stack trace saving interface from ddb. The saving does notVisa Hankala
require the debugger on most architectures, and the separation makes the code easier to use from other subsystems. The function definitions are still conditional to DDB. However, that should not matter for now. OK deraadt@, mpi@
2020-01-09If the kernel panics due to SMEP or SMAP, print correct stack traceAlexander Bluhm
and pass information to ddb. This helps to debug kernel NULL pointer function calls. input guenther@; OK kettenis@
2019-11-12Default to 0 arguments if no symbol has been found in the CTF section.Martin Pieuchot
Symbols not present in the CTF data are generally assembly routines which have either no argument or do not follow the ABI that the various MD stack unwinders understand. This makes ddb(4) trace simpler to understand. ok jasper@
2019-11-07db_addr_t -> vaddr_tMartin Pieuchot
ok deraadt@
2019-11-07FALSE -> 0, missed in previous.Martin Pieuchot
Spotted by deraadt@
2019-11-06Substitute boolean_t/TRUE/FALSE by int/1/0.Martin Pieuchot
ok dlg@, jasper@, anton@
2019-07-20Get rid of `ddb_is_active' instead use `db_active'.Martin Pieuchot
From Christian Ludwig <christian_ludwig at genua dot de> ok visa@
2019-04-02Fix ddb not to write its history to out of the region. When theYASUOKA Masahiko
inputted line just ends at sizeof(db_history), ddb started writing the histories to out of the region. diff from IIJ. ok deraadt anton
2019-04-01remove prototype from earlier version of reboot code. spotted by antonTed Unangst
2019-04-01fast track ddb> reboot command to skip anything which might panic again.Ted Unangst
ok deraadt
2019-02-15zap trailing empty lineanton
2019-02-15The underlying storage for builtin ddb variables are of type int butanton
referenced to using a pointer to long. When writing to such a variable, cast it to the correct type. Writing would otherwise on 64-bit architectures cause the next variable adjacent in memory to also be modified. ok deraadt@ visa@
2019-01-09Printing hex values with right adjustment makes it easier to compareAlexander Bluhm
corresponding digits. So the change the ddb x/x output. OK sashan@ deraadt@ visa@ mpi@
2018-09-18whitespace fix; no binary changeanton
2018-08-31Pass the correct size to free(9) in the error path of db_ctf_decompress().Alexander Bluhm
OK jasper@
2018-05-07Make the print function of db_print_stack_trace() configurable,Visa Hankala
and indicate if a saved stack trace is empty. OK guenther@
2018-01-09Do not truncate 64bit integers when pretty-printing types.Martin Pieuchot
2018-01-05Show uvm_fault and trace when typing show panic on a page fault'd kernelPaul Irofti
Currently there is only support for amd64, if this change settles I will add support for the rest of the architectures. OK kettenis@.
2017-12-13Add 'bt' an alias for 'trace'.Martin Pieuchot
ok pirofti@
2017-12-11In uvm Chuck decided backing store would not be allocated proactivelyTheo de Raadt
for blocks re-fetchable from the filesystem. However at reboot time, filesystems are unmounted, and since processes lack backing store they are killed. Since the scheduler is still running, in some cases init is killed... which drops us to ddb [noted by bluhm]. Solution is to convert filesystems to read-only [proposed by kettenis]. The tale follows: sys_reboot() should pass proc * to MD boot() to vfs_shutdown() which completes current IO with vfs_busy VB_WRITE|VB_WAIT, then calls VFS_MOUNT() with MNT_UPDATE | MNT_RDONLY, soon teaching us that *fs_mount() calls a copyin() late... so store the sizes in vfsconflist[] and move the copyin() to sys_mount()... and notice nfs_mount copyin() is size-variant, so kill legacy struct nfs_args3. Next we learn ffs_mount()'s MNT_UPDATE code is sharp and rusty especially wrt softdep, so fix some bugs adn add ~MNT_SOFTDEP to the downgrade. Some vnodes need a little more help, so tie them to &dead_vnops. ffs_mount calling DIOCCACHESYNC is causing a bit of grief still but this issue is seperate and will be dealt with in time. couple hundred reboots by bluhm and myself, advice from guenther and others at the hut
2017-11-27Remove MALLOC_DEBUG left overs.Martin Pieuchot
From Klemens Nanni.
2017-11-06remove ctf_type declaration no longer needed since -r1.33Jasper Lievisse Adriaanse
ok mpi@
2017-11-01Remove forward declaration hack now that ctfconv(1) merge them correctly.Martin Pieuchot
ok jasper@
2017-10-27Use <elf.h> in !_KERNEL code path.Martin Pieuchot
2017-10-19ddb "show all mounts" showed everything except the address of theAlexander Bluhm
mount point. Print it to allow debugging through the data structures from there. OK krw@
2017-10-13return a missing return (was left out of previous)Jasper Lievisse Adriaanse
2017-10-13- use db_printf()Jasper Lievisse Adriaanse
- refuse to pretty-print if there's no CTF ok mpi@
2017-10-11missing prototype for db_ctf_pprintJasper Lievisse Adriaanse
ok mpi@
2017-09-29New ddb(4) command: kill.Martin Pieuchot
Send an uncatchable SIGABRT to the process specified by the pid argument. Useful in case of CPU exhaustion to kill the DoSing process and generate a core for later inspection. ok phessler@, visa@, kettenis@, miod@
2017-09-12Remove option DDB_STRUCTINFO. Now that ddb(4) is CTF aware, similarMartin Pieuchot
functionnalities are available in GENERIC. ok jasper@, deraadt@, guenther@, dlg@
2017-09-12Skip forward declarations until ctfconv(1) properly merge them withMartin Pieuchot
the corresponding struct definitions. ok dlg@
2017-09-08If you use sys/param.h, you don't need sys/types.hTheo de Raadt
2017-09-06use sizeof(variable) instead of sizeof(type) to shorten some codeDavid Gwynne
2017-09-06when pretty printing a pointer, display its value instead of address.David Gwynne
this makes it consistent with printing of other values. ok mpi@
2017-09-06replace the DDB_STRUCT backend for "show struct" with ctf code.David Gwynne
this lets you inspect arbitrary memory in the kernel as a specified struct. ok mpi@ jasper@
2017-08-14db_ctf_pprintf() doesn't actually support formatting, so s/f$//Uwe Stuehler
ok mpi@