aboutsummaryrefslogtreecommitdiff
path: root/sys/ddb/db_lex.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/
* Adjust db_flush_line() definition to avoid clang 15 warningDimitry Andric2022-07-191-1/+1
| | | | | | | | | | | | | | | With clang 15, the following -Werror warnings is produced: sys/ddb/db_lex.c:94:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] db_flush_line() ^ void This is because db_flush_line() is declared with a (void) argument list, but defined with an empty argument list. Make the definition match the declaration. MFC after: 3 days
* ddb: just move cursor when the lexer backs upRyan Libby2021-02-241-11/+16
| | | | | | | | | | | | | | | Get rid of db_look_char because it's not compatible with db_get_line(). This fixes the following issue: db> script lockinfo=show alllocks db> run lockinfo db:0:lockinfo> how alllocks No such command; use "help" to list available commands Reported by: markj Reviewed by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28725
* ddb(4): Add some support for lexing IPv6 addressesConrad Meyer2019-09-091-3/+13
| | | | | | | | | | | | | | | | | | | | | Allow commands to specify that (hex) numbers may start with A-F, by adding the DRT_HEX flag for db_read_token_flags(). As before, numbers containing invalid digits for the current radix are rejected. Also, lex ':' and '::' tokens as tCOLON and tCOLONCOLON respectively. There is a mild conflict here with lexed "identifiers" (tIDENT): ddb identifiers may contain arbitrary colons, and the ddb lexer is greedy. So the identifier lex will swallow any colons it finds inside identifiers, and consumers are still unable to expect the token sequence 'tIDENT tCOLON'. That limitation does not matter for IPv6 addresses, because the lexer always attempts to lex numbers before identifiers. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D21509 Notes: svn path=/head/; revision=352075
* ddb(4): Enhance lexer functionality for specialized commandsConrad Meyer2019-09-091-9/+35
| | | | | | | | | | | | | | | | | Add a db_read_token_flags() variant of db_read_token() with configurable parameters. Allow specifying an explicit radix for tNUMBER lexing. It overrides the default inference and db_radix setting. Also provide the option of yielding any lexed whitespace (tWSPACE) (instead of ignoring it). This is useful for whitespace-sensitive CS_OWN commands. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D21459 Notes: svn path=/head/; revision=352074
* 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
* Add a small set of logical operators to DDB command language.Pedro F. Giffuni2016-05-161-2/+31
| | | | | | | | | | | | | | 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
* ddb: ANSI-fy function declarations.Pedro F. Giffuni2014-10-121-4/+4
| | | | | | | MFC after: 5 days Notes: svn path=/head/; revision=273006
* Add a simple scripting facility to DDB(4), allowing the user toRobert Watson2007-12-261-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | define a set of named scripts. Each script consists of a list of DDB commands separated by ";"s that will be executed verbatim. No higher level language constructs, such as branching, are provided for: scripts are executed by sequentially injecting commands into the DDB input buffer. Four new commands are present in DDB: "run" to run a specific script, "script" to define or print a script, "scripts" to list currently defined scripts, and "unscript" to delete a script, modeled on shell alias commands. Scripts may also be manipulated using sysctls in the debug.ddb.scripting MIB space, although users will prefer to use the soon-to-be-added ddb(8) tool for usability reasons. Scripts with certain names are automatically executed on various DDB events, such as entering the debugger via a panic, a witness error, watchdog, breakpoint, sysctl, serial break, etc, allowing customized handling. MFC after: 3 months Notes: svn path=/head/; revision=174914
* 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/+4
| | | | Notes: svn path=/head/; revision=116176
* Remove __P.Alfred Perlstein2002-03-201-4/+4
| | | | Notes: svn path=/head/; revision=92756
* Allow '.' in identifiers - some ia64 register names contain '.'.Doug Rabson2002-03-101-1/+1
| | | | Notes: svn path=/head/; revision=92011
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Fixed bogus type of valuep in struct db_variable. It was `int *' andBruce Evans1998-07-081-3/+3
| | | | | | | | became `long *' for alpha, but should always have been `db_expr_t *'. Fixed variable types to match. Notes: svn path=/head/; revision=37504
* Make db_tok_number a long to allow typing 64bit numbers on alpha.Doug Rabson1998-06-271-2/+2
| | | | Notes: svn path=/head/; revision=37198
* 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
* Removed unused #includes.Bruce Evans1997-06-141-2/+1
| | | | Notes: svn path=/head/; revision=26639
* 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
* Reduced and cleaned up #includes.Bruce Evans1995-12-101-2/+2
| | | | Notes: svn path=/head/; revision=12734
* Staticize and cleanup.Poul-Henning Kamp1995-12-101-3/+3
| | | | Notes: svn path=/head/; revision=12720
* 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-6/+9
| | | | Notes: svn path=/head/; revision=12515
* Completed function declarations and/or added prototypes and/or #includesBruce Evans1995-11-241-2/+2
| | | | | | | | | | | | | 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-9/+9
| | | | Notes: svn path=/head/; revision=8876
* Fix up some sloppy coding practices:Garrett Wollman1994-08-181-2/+4
| | | | | | | | | | | | | | | - 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-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | ``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 the LINT kernel compile with -W -Wreturn-type -Wcomment -Werror, andGarrett Wollman1993-11-251-2/+6
| | | | | | | 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-22/+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/+295
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=4