summaryrefslogtreecommitdiffstats
path: root/sys/ddb
Commit message (Collapse)AuthorAgeFilesLines
* pid is 'long' on alpha.mjacob2002-01-171-2/+2
|
* Implement a "kill" DDB command which is an interface to psignal() thatdd2001-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
* GC the a.out support in DDB, nothing anywhere would pull thisphk2001-11-051-402/+0
| | | | file into a build.
* - Include machine/md_var.h to get rid of cpu_reset() warning. (-Wall)arr2001-11-051-0/+1
| | | | Approved by: jhb
* Add a 'reset' command. This is useful for panics really early beforepeter2001-11-031-0/+13
| | | | any symbols are loaded. Especially for unattended machines.
* Make the flag field in the ps output one char wider to account for recentjhb2001-10-201-6/+13
| | | | | growth in the number of flags used. Also, if a thread is blocked on a mutex, print the mutex name in the wait channel column.
* Fill out some gaps in ia64 DDB support. This involves generalising DDB'sdfr2001-09-153-25/+36
| | | | | breakpoint handling slightly to cope with the fact that ia64 instructions are not located on byte boundaries.
* - Whitespace fixes.jhb2001-09-121-16/+9
| | | | - Fix an old bug: p_comm is an array not a pointer, so it can't be NULL.`
* KSE Milestone 2julian2001-09-121-8/+30
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* No tokens should follow #endif.obrien2001-08-151-2/+2
|
* Quiet a variable format-string warning.kris2001-07-191-1/+1
| | | | MFC after: 1 week
* Add 'hwatch' and 'dhwatch' ddb commands analogous to 'watch' andbsd2001-07-113-0/+49
| | | | | | | | | | '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
* A set of changes to reduce the number of include files the kerneljulian2001-07-082-2/+3
| | | | | | takes from /usr/include. I cannot check them on alpha.. (will try beast) Briefly looked at by: Warner Losh <imp@harmony.village.org>
* With this commit, I hereby pronounce gensetdefs past its use-by date.peter2001-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
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-1/+2
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Catch up to header include changes:jhb2001-03-281-0/+2
| | | | | - <sys/mutex.h> now requires <sys/systm.h> - <sys/mutex.h> and <sys/sx.h> now require <sys/lock.h>
* Use macro API for <sys/queue.h>phk2000-12-301-4/+4
|
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-1/+1
| | | | Pointed out by: bde
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-1/+1
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Add a new sysctl "debug.enter_debugger" (when the kernel is compiledarchie2000-01-271-0/+77
| | | | | | | | | with 'options DDB'). Setting this to `ddb' or `gdb' breaks into the kernel debugger in the corresponding mode. This mechanism has proven very useful at Whistle for setting breakpoints, etc., while doing remote serial line kernel debugging. Obtained from: Whistle source tree
* Add a new mechanism, cndbctl(), to tell the console driver thatyokota2000-01-112-8/+2
| | | | | | | | | | | | | | | | | | | | | ddb is entered. Don't refer to `in_Debugger' to see if we are in the debugger. (The variable used to be static in Debugger() and wasn't updated if ddb is entered via traps and panic anyway.) - Don't refer to `in_Debugger'. - Add `db_active' to i386/i386/db_interface.d (as in alpha/alpha/db_interface.c). - Remove cnpollc() stub from ddb/db_input.c. - Add the dbctl function to syscons, pcvt, and sio. (The function for pcvt and sio is noop at the moment.) Jointly developed by: bde and me (The final version was tweaked by me and not reviewed by bde. Thus, if there is any error in this commit, that is entirely of mine, not his.) Some changes were obtained from: NetBSD
* Unused file. This (NetBSD derived) file was obsoleted by kld.peter2000-01-111-381/+0
|
* Fix a typo in the db_kld.c file - it's kld support not raw a.out support.peter2000-01-111-4/+1
| | | | | Always use db_kld.c for symbol table support as the base kernel maintains this information.
* Remove unused macro definition.archie1999-11-021-1/+0
|
* useracc() the prequel:phk1999-10-291-1/+0
| | | | | | | | | | | Merge the contents (less some trivial bordering the silly comments) of <vm/vm_prot.h> and <vm/vm_inherit.h> into <vm/vm.h>. This puts the #defines for the vm_inherit_t and vm_prot_t types next to their typedefs. This paves the road for the commit to follow shortly: change useracc() to use VM_PROT_{READ|WRITE} rather than B_{READ|WRITE} as argument.
* Delete unneeded #includepeter1999-10-111-2/+0
| | | | Submitted by: phk
* $Id$ -> $FreeBSD$peter1999-08-2828-28/+28
|
* Merge the cons.c and cons.h to the best of my ability. alpha may orphk1999-08-094-11/+8
| | | | may not compile, I can't test it.
* The following patch will remove a hack introduced inyokota1999-07-141-13/+1
| | | | | | | /sys/ddb/db_input.c rev 1.19 to recognize syscons's cursor keycodes. It is unnecessary now that scgetc() in syscons returns the escape sequence for the cursor keys rather than their raw, internal key codes.
* Quiet warnings on Alpha. (db_expr_t is a long on alpha, int on x86)peter1999-07-017-27/+26
|
* Removed an especially bogus cast.bde1999-05-131-2/+2
|
* Restored used include of <sys/systm.h>. -Wmissing-prototypes doesn't workbde1999-05-132-2/+5
| | | | for builtin functions.
* add some amount of sanity to the way the gdb stuff finds its device.phk1999-05-092-4/+18
| | | | | | | | 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.
* Get rid of extern declarations on gdb stuff so systems compiled withoutmckusick1999-05-071-1/+9
| | | | | DDB will compile. Warn users that try to use GDB without specifying a GDB port in their configuration file.
* Fixed -Wcast-qual warnings.bde1999-02-123-9/+9
|
* Fixed fatal type mismatches in the aout case. Const poisoning inbde1999-02-121-5/+5
| | | | db_sym.h had not reached here.
* Fix warnings in preparation for adding -Wall -Wcast-qual to thedillon1999-01-276-45/+47
| | | | | | | kernel compile. This commit includes significant work to proper handle const arguments for the DDB symbol routines.
* Changes to support -Wall, -Wcast-qual. Had to make physical code changesdillon1999-01-277-30/+33
| | | | | in db_lookup() to avoid the *cp = 0 / *cp = ':' combo ( temporary nul-terminate-then-restore-original ) on a const char * string.
* Replace includes of <sys/kernel.h> with includes ofjdp1999-01-141-2/+2
| | | | | <sys/linker_set.h> in those files that use only the linker set definitions.
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-4/+2
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* Forgot to commit this; the alpha uses the kld symbol interface now. Thepeter1998-10-151-2/+2
| | | | tables that db_elf.c is expecting are not loaded in that format any more.
* Call some helper routines to be supplied by kern_linker.c in order topeter1998-10-091-14/+7
| | | | | | | get to all the symbol tables for all modules, not just the core kernel symbol table. Yes, DDB can see KLD module symbols with this, both by lookup and in tracebacks. No more references to _end from tracebacks within an LKM. :-)
* At the moment, the alpha tentatively uses the ddb elf code rather than KLD,peter1998-10-091-10/+4
| | | | | | | because the alpha boot loader hasn't been converted yet, and because it needs the full symbol tables with local symbols in order to make sense of stack tracebacks. KLD will implement this (using full sybmol table rather than the globals only) shortly.
* We don't compile this on an elf kernel (and explicitly not on alpha inpeter1998-10-091-5/+4
| | | | | | case it's possible to compile in something like ECOFF) The three db_xxx.c symbol interfaces are "standard" because config isn't flexible enough without forcing the user to know about it.
* Update to work with the new elf headers.dfr1998-08-171-17/+2
|
* Added macros __printflike() and __scanflike() to <sys/cdefs.h>.bde1998-07-131-4/+3
| | | | | | | | Use them to `make gcc -Wformat' check formats for all printf-like and scanf-like functions in /usr/src except for the err()/warn() family. err() isn't quite printf-like since its format arg can legitimately be NULL. syslog() isn't quite printf-like, but gcc already accepts %m, even for plain printf() when it shouldn't.
* Use not-so-new printf formats %r and/or %z instead of %n and/or %+x.bde1998-07-085-16/+16
|
* Fixed bogus type of valuep in struct db_variable. It was `int *' andbde1998-07-088-22/+23
| | | | | became `long *' for alpha, but should always have been `db_expr_t *'. Fixed variable types to match.
* Fixed db_printf format errors.bde1998-07-085-19/+18
|
OpenPOWER on IntegriCloud