summaryrefslogtreecommitdiff
path: root/sys/ddb/db_command.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove the need to forward declare statics by moving them around.David E. O'Brien2005-08-101-57/+54
| | | | Notes: svn path=/head/; revision=148919
* Implement functions calls from within DDB on ia64. On ia64 a functionMarcel Moolenaar2005-07-021-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | pointer doesn't point to the first instruction of that function, but rather to a descriptor. The descriptor has the address of the first instruction, as well as the value of the global pointer. The symbol table doesn't know anything about descriptors, so if you lookup the name of a function you get the address of the first instruction. The cast from the address, which is the result of the symbol lookup, to a function pointer as is done in db_fncall is therefore invalid. Abstract this detail behind the DB_CALL macro. By default DB_CALL is defined as db_fncall_generic, which yields the old behaviour. On ia64 the macro is defined as db_fncall_ia64, in which a descriptor is constructed to yield a valid function pointer. While here, introduce DB_MAXARGS. DB_MAXARGS replaces the existing (local) MAXARGS. The DB_MAXARGS macro can be defined by platforms to create a convenient maximum. By default this will be the legacy 10. On ia64 we define this macro to be 8, for 8 is the maximum number of arguments that can be passed in registers. This avoids having to implement spilling of arguments on the memory stack. Approved by: re (dwhite) Notes: svn path=/head/; revision=147745
* Start each of the license/copyright comments with /*-Warner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139747
* When printing a stack trace for a thread, also print the pid and tid.Robert Watson2004-11-231-0/+6
| | | | | | | | | When a series of traces is included in a bug report, this will make it easier to tie the trace information back to ps or threads output, each of which will show the pid or the tid, but usually not both. Notes: svn path=/head/; revision=138038
* Oops... Add the CS_OWN flag to the trace and where commands so thatMarcel Moolenaar2004-07-211-2/+2
| | | | | | | db_stack_trace() actually has a chance to parse its own arguments. Notes: svn path=/head/; revision=132484
* Unify db_stack_trace_cmd(). All it did was look up the thread givenMarcel Moolenaar2004-07-211-2/+43
| | | | | | | | | | | | | | | | | | the thread ID and call db_trace_thread(). Since arm has all the logic in db_stack_trace_cmd(), rename the new DB_COMMAND function to db_stack_trace to avoid conflicts on arm. While here, have db_stack_trace parse its own arguments so that we can use a more natural radix for IDs. If the ID is not a thread ID, or more precisely when no thread exists with the ID, try if there's a process with that ID and return the first thread in it. This makes it easier to print stack traces from the ps output. requested by: rwatson@ tested on: amd64, i386, ia64 Notes: svn path=/head/; revision=132482
* Re-add the gdb command. It was removed to be replaced by somethingMarcel Moolenaar2004-07-121-0/+12
| | | | | | | | | | | | more generic, but that didn't actually happen. Since the feature to switch backends (and historically this means from DDB to GDB) is important, make sure people can do just that until such the generic mechanism actually sees the light of day. Suggested by: rwatson@ Notes: svn path=/head/; revision=132002
* Mega update for the KDB framework: turn DDB into a KDB backend.Marcel Moolenaar2004-07-101-53/+4
| | | | | | | | | | | | | | | | | | | 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
* Give DDB a "watchdog" command which disables all watchdogs.Poul-Henning Kamp2004-02-291-0/+21
| | | | Notes: svn path=/head/; revision=126399
* Further cleanup <machine/cpu.h> and <machine/md_var.h>: move the MIMarcel Moolenaar2003-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | prototypes of cpu_halt(), cpu_reset() and swi_vm() from md_var.h to cpu.h. This affects db_command.c and kern_shutdown.c. ia64: move all MD prototypes from cpu.h to md_var.h. This affects madt.c, interrupt.c and mp_machdep.c. Remove is_physical_memory(). It's not used (vm_machdep.c). alpha: the MD prototypes have been left in cpu.h with a comment that they should be there. Moving them is left for later. It was expected that the impact would be significant enough to be done in a seperate commit. powerpc: MD prototypes left in cpu.h. Comment added. Suggested by: bde Tested with: make universe (pc98 incomplete) Notes: svn path=/head/; revision=118990
* Add a one-shot callout facility to db_printf() that executes the registeredJohn Baldwin2003-07-311-0/+1
| | | | | | | | | | | | callout when a specified number of lines have been output. This can be used to implement pagers for ddb commands that output a lot of text. A simple paging function is included that automatically rearms itself when fired. Reviewed by: bde, julian Notes: svn path=/head/; revision=118268
* Use __FBSDID().David E. O'Brien2003-06-101-4/+4
| | | | Notes: svn path=/head/; revision=116176
* Make "where" an alias for "trace"Poul-Henning Kamp2003-06-011-0/+1
| | | | Notes: svn path=/head/; revision=115607
* Change "dev_t gdbdev" to "void *gdb_arg", some possible paths for GDBPoul-Henning Kamp2003-02-161-2/+2
| | | | | | | will not have a dev_t. Notes: svn path=/head/; revision=111017
* Add code to ddb to allow backtracing an arbitrary thread.Julian Elischer2002-12-281-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | (show thread {address}) Remove the IDLE kse state and replace it with a change in the way threads sahre KSEs. Every KSE now has a thread, which is considered its "owner" however a KSE may also be lent to other threads in the same group to allow completion of in-kernel work. n this case the owner remains the same and the KSE will revert to the owner when the other work has been completed. All creations of upcalls etc. is now done from kse_reassign() which in turn is called from mi_switch or thread_exit(). This means that special code can be removed from msleep() and cv_wait(). kse_release() does not leave a KSE with no thread any more but converts the existing thread into teh KSE's owner, and sets it up for doing an upcall. It is just inhibitted from being scheduled until there is some reason to do an upcall. Remove all trace of the kse_idle queue since it is no-longer needed. "Idle" KSEs are now on the loanable queue. Notes: svn path=/head/; revision=108338
* Indentation indicates missing braces.Poul-Henning Kamp2002-10-011-1/+2
| | | | | | | Spotted by: FlexeLint Notes: svn path=/head/; revision=104321
* Constify to kill some warnings.Mark Murray2002-09-211-1/+1
| | | | Notes: svn path=/head/; revision=103746
* Fixed some style bugs in the removal of __P(()). Continuation linesBruce Evans2002-03-231-12/+8
| | | | | | | | were not outdented to preserve non-KNF lining up of code with parentheses. Switch to KNF formatting. Notes: svn path=/head/; revision=93009
* Remove __P.Alfred Perlstein2002-03-201-8/+8
| | | | Notes: svn path=/head/; revision=92756
* pid is 'long' on alpha.Matt Jacob2002-01-171-2/+2
| | | | Notes: svn path=/head/; revision=89442
* Implement a "kill" DDB command which is an interface to psignal() thatDima Dorfman2001-11-271-0/+59
| | | | | | | | | | | | | | | | | | respects locks. Before SMPng, one was able to call psignal() using the "call" command, but this is no longer possible because it does not respect locks by itself. This is very useful when one has gotten their machine into a state where it is impossible to spawn ps/kill or su to root. In this case, respecting locks essentially means trying to aquire the proc lock before calling psignal(). We can't block in the debugger, so if trylock fails, the operation fails. This also means that we can't use pfind(), since that will attempt to lock the process for us. Reviewed by: jhb Notes: svn path=/head/; revision=86998
* - Include machine/md_var.h to get rid of cpu_reset() warning. (-Wall)Andrew R. Reiter2001-11-051-0/+1
| | | | | | | Approved by: jhb Notes: svn path=/head/; revision=86109
* Add a 'reset' command. This is useful for panics really early beforePeter Wemm2001-11-031-0/+13
| | | | | | | any symbols are loaded. Especially for unattended machines. Notes: svn path=/head/; revision=85944
* Quiet a variable format-string warning.Kris Kennaway2001-07-191-1/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=79884
* Add 'hwatch' and 'dhwatch' ddb commands analogous to 'watch' andBrian S. Dean2001-07-111-0/+2
| | | | | | | | | | | | | 'dwatch'. The new commands install hardware watchpoints if supported by the architecture and if there are enough registers to cover the desired memory area. No objection by: audit@, hackers@ MFC after: 2 weeks Notes: svn path=/head/; revision=79573
* A set of changes to reduce the number of include files the kernelJulian Elischer2001-07-081-1/+1
| | | | | | | | | takes from /usr/include. I cannot check them on alpha.. (will try beast) Briefly looked at by: Warner Losh <imp@harmony.village.org> Notes: svn path=/head/; revision=79418
* With this commit, I hereby pronounce gensetdefs past its use-by date.Peter Wemm2001-06-131-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace the a.out emulation of 'struct linker_set' with something a little more flexible. <sys/linker_set.h> now provides macros for accessing elements and completely hides the implementation. The linker_set.h macros have been on the back burner in various forms since 1998 and has ideas and code from Mike Smith (SET_FOREACH()), John Polstra (ELF clue) and myself (cleaned up API and the conversion of the rest of the kernel to use it). The macros declare a strongly typed set. They return elements with the type that you declare the set with, rather than a generic void *. For ELF, we use the magic ld symbols (__start_<setname> and __stop_<setname>). Thanks to Richard Henderson <rth@redhat.com> for the trick about how to force ld to provide them for kld's. For a.out, we use the old linker_set struct. NOTE: the item lists are no longer null terminated. This is why the code impact is high in certain areas. The runtime linker has a new method to find the linker set boundaries depending on which backend format is in use. linker sets are still module/kld unfriendly and should never be used for anything that may be modular one day. Reviewed by: eivind Notes: svn path=/head/; revision=78161
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Merge the cons.c and cons.h to the best of my ability. alpha may orPoul-Henning Kamp1999-08-091-3/+2
| | | | | | | may not compile, I can't test it. Notes: svn path=/head/; revision=49558
* Quiet warnings on Alpha. (db_expr_t is a long on alpha, int on x86)Peter Wemm1999-07-011-2/+2
| | | | Notes: svn path=/head/; revision=48407
* add some amount of sanity to the way the gdb stuff finds its device.Poul-Henning Kamp1999-05-091-3/+7
| | | | | | | | | | | I'm not too happy about the result either, but at least it has less chance of backfiring. This particular feature could be called "a mess" without offending anybody. Notes: svn path=/head/; revision=46783
* Get rid of extern declarations on gdb stuff so systems compiled withoutKirk McKusick1999-05-071-1/+9
| | | | | | | | DDB will compile. Warn users that try to use GDB without specifying a GDB port in their configuration file. Notes: svn path=/head/; revision=46658
* Replace includes of <sys/kernel.h> with includes ofJohn Polstra1999-01-141-2/+2
| | | | | | | | <sys/linker_set.h> in those files that use only the linker set definitions. Notes: svn path=/head/; revision=42654
* Use not-so-new printf formats %r and/or %z instead of %n and/or %+x.Bruce Evans1998-07-081-2/+2
| | | | Notes: svn path=/head/; revision=37506
* Redo the previous commit in a more Bruce-friendly fashion.Poul-Henning Kamp1998-05-191-2/+1
| | | | | | | Urged by: bde Notes: svn path=/head/; revision=36197
* Add "show msgbuf" commandPoul-Henning Kamp1998-05-191-1/+2
| | | | Notes: svn path=/head/; revision=36181
* Ensure that the linker sets for commands exist by putting a standardBruce Evans1998-02-131-15/+7
| | | | | | | | command in each of them. This removes the need for hard-to-configure dummy instantiations of the sets. Notes: svn path=/head/; revision=33296
* Staticize.Eivind Eklund1998-02-091-2/+2
| | | | Notes: svn path=/head/; revision=33181
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Fixed bogus linkage of one of the ddb linker sets.Bruce Evans1996-12-181-2/+6
| | | | Notes: svn path=/head/; revision=20649
* Support statically attaching of ddb commands in non-ddb modules.Bruce Evans1996-09-141-32/+70
| | | | | | | | | | | | | | | | | | | The details are hidden in the DB_COMMAND(cmd_name, func_name) and DB_SHOW_COMMAND(cmd_name, func_name) macros. DB_COMMAND() adds to the top-level ddb command table and DB_SHOW_COMMAND adds to the `show' subtable. Most external commands will probably be `show' commands with no side effects. They should check their pointer args more carefully than `show map' :-), or ddb should trap internal faults better (like it does for memory accesses). The vm ddb commands are temporarily unattached. ddb.h: Also declare `db_indent' and db_iprintf() which will replace vm's `indent' and iprintf(). Notes: svn path=/head/; revision=18296
* Allow the user to switch into gdb mode from ddbPaul Traina1996-08-271-1/+21
| | | | Notes: svn path=/head/; revision=17848
* Reduced and cleaned up #includes.Bruce Evans1995-12-101-4/+3
| | | | Notes: svn path=/head/; revision=12734
* Untangled the vm.h include file spaghetti.David Greenman1995-12-071-1/+4
| | | | Notes: svn path=/head/; revision=12662
* Staticized and '#ifdef notused' stuff we don't use.Poul-Henning Kamp1995-11-291-14/+16
| | | | Notes: svn path=/head/; revision=12515
* Completed function declarations and/or added prototypes and/or #includesBruce Evans1995-11-241-18/+16
| | | | | | | | | | | | | to get the prototypes. Changed some `int's to `boolean_t's. boolean_t's are ints so they are hard to distinguish from ints. Converted function headers to old-style. ddb is written in K&R1 C except where we broke it. Notes: svn path=/head/; revision=12473
* Change db_fncall() and db_panic() to have the correct number and type ofBruce Evans1995-08-271-5/+13
| | | | | | | args for a ddb command. Notes: svn path=/head/; revision=10348
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-8/+8
| | | | Notes: svn path=/head/; revision=8876
* Removed redundant newlines that were in some panic strings.David Greenman1995-03-191-2/+2
| | | | Notes: svn path=/head/; revision=7170