summaryrefslogtreecommitdiff
path: root/sys/ddb/db_thread.c
Commit message (Collapse)AuthorAgeFilesLines
* proc: eliminate the zombproc listMateusz Guzik2019-08-281-10/+2
| | | | | | | | | | | | It is not needed by anything in the kernel and it slightly drives up contention on both proctree and allproc locks. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21447 Notes: svn path=/head/; revision=351572
* ddb: Enable 'thread <address>'Conrad Meyer2018-10-201-11/+1
| | | | | | | | | | | | | | | | | | Currently, the 'thread' command (to switch the debugger to another thread) only accepts decimal-encoded tids. Use the same parsing logic as 'show thread <arg>' to accept hex-encoded thread pointers in addition to decimal-encoded tids. Document the 'thread' command in ddb.4 and expand the 'show thread' documentation to cover the tid usage. Reported by: bwidawsk Reviewed by: bwidawsk (earlier version), kib (earlier version), markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16962 Notes: svn path=/head/; revision=339486
* sys/ddb: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326267
* ddb: finish converting boolean values.Pedro F. Giffuni2015-05-211-3/+3
| | | | | | | | | | | | The replacement started at r283088 was necessarily incomplete without replacing boolean_t with bool. This also involved cleaning some type mismatches and ansifying old C function declarations. Pointed out by: bde Discussed with: bde, ian, jhb Notes: svn path=/head/; revision=283248
* Show the thread kernel stack base address for 'show threads'.Konstantin Belousov2011-12-161-1/+2
| | | | | | | | Discussed with: pho MFC after: 1 week Notes: svn path=/head/; revision=228568
* Typo.Konstantin Belousov2011-12-091-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=228376
* MFp4 @178364:Bjoern A. Zeeb2010-05-241-29/+2
| | | | | | | | | | | | | | | | | | | | | Implement an optional delay to the ddb reset/reboot command. This allows textdumps to be run automatically with unattended reboots after a resonable timeout, while still permitting an administrator to break into debugger if attached to the console at the time of the event for further debugging. Cap the maximum delay at 1 week to avoid highly accidental results, and default to 15s in case of problems parsing the timeout value. Move hex2dec helper function from db_thread.c to db_command.c to make it generally available and prefix it with a "db_" to avoid namespace collisions. Reviewed by: rwatson MFC after: 4 weeks Notes: svn path=/head/; revision=208509
* Add a space before printing 'thread pid ...' to match the space beforeRui Paulo2010-02-121-1/+1
| | | | | | | ']'. Notes: svn path=/head/; revision=203804
* Use FOREACH_PROC_IN_SYSTEM instead of using its unrolled form.Xin LI2007-01-171-2/+2
| | | | Notes: svn path=/head/; revision=166074
* Simplify the pager support in DDB. Allowing different db commands toJohn Baldwin2006-07-121-5/+1
| | | | | | | | | | | | | | | | | | | install custom pager functions didn't actually happen in practice (they all just used the simple pager and passed in a local quit pointer). So, just hardcode the simple pager as the only pager and make it set a global db_pager_quit flag that db commands can check when the user hits 'q' (or a suitable variant) at the pager prompt. Also, now that it's easy to do so, enable paging by default for all ddb commands. Any command that wishes to honor the quit flag can do so by checking db_pager_quit. Note that the pager can also be effectively disabled by setting $lines to 0. Other fixes: - 'show idt' on i386 and pc98 now actually checks the quit flag and terminates early. - 'show intr' now actually checks the quit flag and terminates early. Notes: svn path=/head/; revision=160312
* Add two helper functions: db_lookup_thread() and db_lookup_proc(). TheyJohn Baldwin2006-04-251-0/+92
| | | | | | | | | | | | | | | | | | | take the addr value passed to a ddb command and attempt to use it to lookup a struct thread * or struct proc *, respectively. Each function first reparses the passed in value as if it was an ID entered in base 10. For threads the ID is treated as a thread ID, for proceses the ID is treated as a PID. If a thread or proc matching the ID is found, it is returned. For db_lookup_thread(), if the check_pid argument is true and it didn't find a thread with a matching thread ID, it will treat the ID as a PID and look for a matching process. If it finds one it returns the first thread in the process. If none of the ID lookups succeeded, then the functions assume that the passed in address is a thread or proc pointer, respectively. This allows one to use tids, pids, or structure pointers interchangeably in ddb functions that want to lookup threads or processes if desired. Notes: svn path=/head/; revision=158029
* Start each of the license/copyright comments with /*-Warner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139747
* When printing information on the current thread, such as when enteringRobert Watson2004-11-231-1/+6
| | | | | | | | | DDB, also print the pid of the process if present. Since much debugging still centers around processes, having the pid is quite helpful. Notes: svn path=/head/; revision=138037
* - Change the ddb paging "support" to use a variable (db_lines_per_page) toJohn Baldwin2004-11-011-1/+1
| | | | | | | | | | | | | | | | | | | | control the number of lines per page rather than a constant. The variable can be examined and changed in ddb as '$lines'. Setting the variable to 0 will effectively turn off paging. - Change db_putchar() to force out pending whitespace before outputting newlines and carriage returns so that one can rub out content on the current line via '\r \r' type strings. - Change the simple pager to rub out the --More-- prompt explicitly when the routine exits. - Add some aliases to the simple pager to make it more compatible with more(1): 'e' and 'j' do a single line. 'd' does half a page, and 'f' does a full page. MFC after: 1 month Inspired by: kris Notes: svn path=/head/; revision=137117
* Mega update for the KDB framework: turn DDB into a KDB backend.Marcel Moolenaar2004-07-101-0/+105
Most of the changes are a direct result of adding thread awareness. Typically, DDB_REGS is gone. All registers are taken from the trapframe and backtraces use the PCB based contexts. DDB_REGS was defined to be a trapframe on all platforms anyway. Thread awareness introduces the following new commands: thread X switch to thread X (where X is the TID), show threads list all threads. The backtrace code has been made more flexible so that one can create backtraces for any thread by giving the thread ID as an argument to trace. With this change, ia64 has support for breakpoints. Notes: svn path=/head/; revision=131952