aboutsummaryrefslogtreecommitdiff
path: root/sys/ddb/db_examine.c
Commit message (Collapse)AuthorAgeFilesLines
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* SPDX: Consider code from Carnegie-Mellon University.Pedro F. Giffuni2017-11-301-0/+2
| | | | | | | Interesting cases, most likely from CMU Mach sources. Notes: svn path=/head/; revision=326403
* Determine the operand/address size of %cs in a new functionBruce Evans2016-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | db_segsize(). Use db_segsize() to set the default operand/address size for disassembling. Allow overriding this with the "alternate" display format /I. The API of db_disasm() should be debooleanized to pass a more general request (amd64 needs overrides to sizes of 16, 32, and 64, but this commit doesn't implement anything for amd64 since much larger changes are needed to restore the amd64 disassmbler's support for non-default sizes). Fix db_print_loc_and_inst() to ask for the normal format and not the alternate in normal operation. This is most useful for vm86 mode, but also works for 16-bit protected mode. Use db_segsize() to avoid trying to print a garbage stack trace if %cs is 16 bits. Print something like the stack trace termination message for a trap boundary instead. Document that the alternate format is now useful on i386. Notes: svn path=/head/; revision=306311
* Add a small set of logical operators to DDB command language.Pedro F. Giffuni2016-05-161-0/+4
| | | | | | | | | | | | | | This are based on Mach3. Documentation is pending but has been promised. Submitted by: Dan Partelly Reviewed by: adrian, jhb (older version) Differential Revision: https://reviews.freebsd.org/D4230 RelNotes: yes Notes: svn path=/head/; revision=299970
* Revert r298938: Change x/a to work similar to gdb.Pedro F. Giffuni2016-05-061-13/+10
| | | | | | | | This badly breaks x/ia: ddb and gdb syntax are quite different and it is unclear if they can be reconciled. Notes: svn path=/head/; revision=299194
* Enhance the ddb examine (x) command.Pedro F. Giffuni2016-05-021-10/+13
| | | | | | | | | | | | | | | | | | | | * Change x/a to work similar to gdb. The content of the memory is treated as an address, printed symbolically and the address is advanced. This way you can x/a <stack_address> and then just hit return a bunch of times to locate useful data on the stack. * Add x/p. The content of the memory is treated as an address and printed as hex. This is based on the similar commit from DragonFlyBSD without the cosmetic changes. Relnotes: yes Obtained from: DragonflyBSD (Matthew Dillon) Reference: 0624d20e86affcd708609cbf9014207537537a72 Notes: svn path=/head/; revision=298938
* Don't return undefined symbols to a DDB symbol lookup.Mark Johnston2015-07-211-2/+6
| | | | | | | | | | | | | | | | | | | Undefined symbols have a value of zero, so it makes no sense to return such a symbol when performing a lookup by value. This occurs for example when unwinding the stack after calling a NULL function pointer, and we confusingly report the faulting function as uart_sab82532_class() on amd64. Convert db_print_loc_and_inst() to only attempt disassembly if we managed to find a symbol corresponding to the IP. Otherwise we may fault and re-enter the debugger. Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D2858 Notes: svn path=/head/; revision=285774
* ddb: finish converting boolean values.Pedro F. Giffuni2015-05-211-6/+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
* ddb: stop boolean screaming.Pedro F. Giffuni2015-05-181-13/+13
| | | | | | | | | | TRUE --> true FALSE--> false Hinted by: NetBSD Notes: svn path=/head/; revision=283088
* ddb: ANSI-fy function declarations.Pedro F. Giffuni2014-10-121-29/+10
| | | | | | | MFC after: 5 days Notes: svn path=/head/; revision=273006
* Add a /S mode to DDB "ex" command, which interprets and prints theRobert Watson2008-03-071-0/+6
| | | | | | | | | | | | | | | | | | | value at the requested address as a symbol. For example, "ex /S aio_swake" prints the name of the function currently registered in via aio_swake hook. The change as committed differs slightly from the patch in the PR, as I force the size of the retrieved value (and the automatic address increment) to be sizeof(void *). This seems to provide the most useful auto-increment behavior, and defaults using the default size (4), which is not sizeof(void *) on 64-bit platforms. MFC after: 3 days PR: 57976 Submitted by: Dan Strick <strick at covad.net> Notes: svn path=/head/; revision=176914
* Make the examine command honor db_pager_quit so you can use 'q' or 'x'John Baldwin2007-10-271-1/+1
| | | | | | | | | at the pager prompt to abort an examine command that spans multiple pages. MFC after: 1 week Notes: svn path=/head/; revision=173077
* Fixed formatting of printing of command tables. WIth the default maxBruce Evans2006-10-081-1/+1
| | | | | | | | | | | | | | | | | | output width of 79, only 6 columns of width 12 each fit, but 7 columns were printed. The fix is to pass the width of the next output to db_end_line() and not assume there that this width is always 1. Related unfixed bugs: - 1 character is wasted for a space after the last column - suppression of trailing spaces used to limit the misformatting, but seems to have been lost - in db_examine(), the width of the next output is not know and is still assumed to be 1. Notes: svn path=/head/; revision=163134
* Start each of the license/copyright comments with /*-Warner Losh2005-01-061-1/+1
| | | | Notes: svn path=/head/; revision=139747
* Use __FBSDID().David E. O'Brien2003-06-101-3/+3
| | | | Notes: svn path=/head/; revision=116176
* - Rename the DDB specific %z printf format to %y.Maxime Henrion2002-10-251-2/+2
| | | | | | | | | | | | | - Make DDB use %y instead of %z. - Teach GCC about %y. - Implement support for the C99 %z format modifier. Approved by: re@ Reviewed by: peter Tested on: i386, sparc64 Notes: svn path=/head/; revision=105954
* Don't assume that pointers are 4 bytes or sizeof(int) in size. This fixesThomas Moestl2002-06-251-5/+2
| | | | | | | | | the indirection operator ('*') and address examination ('x/a') on big-endian platoforms for which the above is not true, as well as on little-endian platforms if the cut-off bits are not 0. Notes: svn path=/head/; revision=98815
* Remove __P.Alfred Perlstein2002-03-201-2/+2
| | | | Notes: svn path=/head/; revision=92756
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Quiet warnings on Alpha. (db_expr_t is a long on alpha, int on x86)Peter Wemm1999-07-011-13/+13
| | | | Notes: svn path=/head/; revision=48407
* Restored used include of <sys/systm.h>. -Wmissing-prototypes doesn't workBruce Evans1999-05-131-1/+3
| | | | | | | for builtin functions. Notes: svn path=/head/; revision=47098
* Use not-so-new printf formats %r and/or %z instead of %n and/or %+x.Bruce Evans1998-07-081-5/+5
| | | | Notes: svn path=/head/; revision=37506
* Fixed db_printf format errors (except for ones using broken extensionsBruce Evans1998-07-081-7/+7
| | | | | | | | | | | | (nonstandard %n and '+' with %x), and ones not found by -Wformat on 386's (some db_expr_t's are still printed as ints). I decided not to change the arg type for %n from [unsigned] int to register_t, since about half of the uses of %n are to print plain ints and casting to [unsigned] long for %n is no harder than for %x. Notes: svn path=/head/; revision=37495
* Support 'g' format for printing 8 byte values.Doug Rabson1998-07-051-1/+5
| | | | Notes: svn path=/head/; revision=37390
* Use %+11ln for printing in r format to make it work for 64bit registers.Doug Rabson1998-06-271-7/+7
| | | | Notes: svn path=/head/; revision=37197
* Add initial support for the FreeBSD/alpha kernel. This is very much aDoug Rabson1998-06-101-2/+2
| | | | | | | | | | | | | work in progress and has never booted a real machine. Initial development and testing was done using SimOS (see http://simos.stanford.edu for details). On the SimOS simulator, this port successfully reaches single-user mode and has been tested with loads as high as one copy of /bin/ls :-). Obtained from: partly from NetBSD/alpha Notes: svn path=/head/; revision=36849
* Make DDB work again after I broke it :-(.Doug Rabson1998-06-081-2/+2
| | | | Notes: svn path=/head/; revision=36760
* This commit fixes various 64bit portability problems required forDoug Rabson1998-06-071-2/+2
| | | | | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time. Notes: svn path=/head/; revision=36735
* Fixed gratuitous ANSIisms.Bruce Evans1997-04-011-4/+3
| | | | Notes: svn path=/head/; revision=24490
* 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 the one remaining %r.Bruce Evans1996-01-211-2/+2
| | | | Notes: svn path=/head/; revision=13539
* Get rid of two and a half printf in the kernel.Poul-Henning Kamp1996-01-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Add more features to the one remaining to handle the job: + signed quantity. # alternate format - left padding * read width as next arg. n numeric in (argument specified) default radix. Fix the DDB debugger to use these. Use vprintf in debug routine in pcvt. The warnings from gcc may become more wrong and intolerable because of this. Warning: I have not checked the entire source for unsupported or changed constructs, but generally belive that there are only a few. Suggested by: bde Notes: svn path=/head/; revision=13446
* Reduced and cleaned up #includes.Bruce Evans1995-12-101-3/+1
| | | | Notes: svn path=/head/; revision=12734
* Untangled the vm.h include file spaghetti.David Greenman1995-12-071-1/+2
| | | | Notes: svn path=/head/; revision=12662
* Staticized and '#ifdef notused' stuff we don't use.Poul-Henning Kamp1995-11-291-3/+3
| | | | Notes: svn path=/head/; revision=12515
* Completed function declarations and/or added prototypes and/or #includesBruce Evans1995-11-241-4/+8
| | | | | | | | | | | | | 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
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-8/+8
| | | | Notes: svn path=/head/; revision=8876
* Print the address associated with an examine. Changed db_maxoff toDavid Greenman1995-05-221-11/+4
| | | | | | | | something more reasonable (64k). Suggested by Gordon Ross about a year ago. Notes: svn path=/head/; revision=8698
* Fix up some sloppy coding practices:Garrett Wollman1994-08-181-4/+1
| | | | | | | | | | | | | | | - Delete redundant declarations. - Add -Wredundant-declarations to Makefile.i386 so they don't come back. - Delete sloppy COMMON-style declarations of uninitialized data in header files. - Add a few prototypes. - Clean up warnings resulting from the above. NB: ioconf.c will still generate a redundant-declaration warning, which is unavoidable unless somebody volunteers to make `config' smarter. Notes: svn path=/head/; revision=2112
* Change all #includes to follow the current Berkeley style. Some of theseGarrett Wollman1994-08-131-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | ``changes'' are actually not changes at all, but CVS sometimes has trouble telling the difference. This also includes support for second-directory compiles. This is not quite complete yet, as `config' doesn't yet do the right thing. You can still make it work trivially, however, by doing the following: rm /sys/compile mkdir /usr/obj/sys/compile ln -s M-. /sys/compile cd /sys/i386/conf config MYKERNEL cd ../../compile/MYKERNEL ln -s /sys @ rm machine ln -s @/i386/include machine make depend make Notes: svn path=/head/; revision=2056
* Make everything compile with -Wtraditional. Make it easier to distributeGarrett Wollman1993-12-191-6/+7
| | | | | | | | | | | | | | a binary link-kit. Make all non-optional options (pagers, procfs) standard, and update LINT to reflect new symtab requirements. NB: -Wtraditional will henceforth be forgotten. This editing pass was primarily intended to detect any constructions where the old code might have been relying on traditional C semantics or syntax. These were all fixed, and the result of fixing some of them means that -Wall is now a realistic possibility within a few weeks. Notes: svn path=/head/; revision=879
* Make the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, andGarrett Wollman1993-11-251-12/+12
| | | | | | | add same (sans -Werror) to Makefile for future compilations. Notes: svn path=/head/; revision=798
* Removed all patch kit headers, sccsid and rcsid strings, put $Id$ in, someRodney W. Grimes1993-10-161-27/+2
| | | | | | | minor cleanup. Added $Id$ to files that did not have any version info, etc Notes: svn path=/head/; revision=623
* Initial import, 0.1 + pk 0.2.4-B1Rodney W. Grimes1993-06-121-0/+364
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=4