2 " Language: GDB command files
3 " Maintainer: Claudio Fleiner <claudio@fleiner.com>
4 " URL: http://www.fleiner.com/vim/syntax/gdb.vim
5 " Last Change: 2001 May 10
7 " For version 5.x: Clear all syntax items
8 " For version 6.x: Quit when a syntax file was already loaded
11 elseif exists("b:current_syntax")
15 syn keyword gdbInfo contained address architecture args breakpoints catch common copying dcache
16 syn keyword gdbInfo contained display files float frame functions handle line
17 syn keyword gdbInfo contained locals program registers scope set sharedlibrary signals
18 syn keyword gdbInfo contained source sources stack symbol target terminal threads
19 syn keyword gdbInfo contained syn keyword tracepoints types udot variables warranty watchpoints
20 syn match gdbInfo contained "all-registers"
23 syn keyword gdbStatement contained actions apply attach awatch backtrace break bt call catch cd clear collect commands
24 syn keyword gdbStatement contained complete condition continue delete detach directory disable disassemble display down
25 syn keyword gdbStatement contained echo else enable end file finish frame handle hbreak help if ignore
26 syn keyword gdbStatement contained inspect jump kill list load maintenance make next nexti ni output overlay
27 syn keyword gdbStatement contained passcount path print printf ptype pwd quit rbreak remote return run rwatch
28 syn keyword gdbStatement contained search section set sharedlibrary shell show si signal source step stepi stepping
29 syn keyword gdbStatement contained stop target tbreak tdump tfind thbreak thread tp trace tstart tstatus tstop
30 syn keyword gdbStatement contained tty undisplay unset until up watch whatis where while ws x
31 syn match gdbFuncDef "\<define\>.*"
32 syn match gdbStatmentContainer "^\s*\S\+" contains=gdbStatement,gdbFuncDef
33 syn match gdbStatement "^\s*info" nextgroup=gdbInfo skipwhite skipempty
35 " some commonly used abreviations
36 syn keyword gdbStatement c disp undisp disas p
38 syn region gdbDocument matchgroup=gdbFuncDef start="\<document\>.*$" matchgroup=gdbFuncDef end="^end$"
40 syn match gdbStatement "\<add-shared-symbol-files\>"
41 syn match gdbStatement "\<add-symbol-file\>"
42 syn match gdbStatement "\<core-file\>"
43 syn match gdbStatement "\<dont-repeat\>"
44 syn match gdbStatement "\<down-silently\>"
45 syn match gdbStatement "\<exec-file\>"
46 syn match gdbStatement "\<forward-search\>"
47 syn match gdbStatement "\<reverse-search\>"
48 syn match gdbStatement "\<save-tracepoints\>"
49 syn match gdbStatement "\<select-frame\>"
50 syn match gdbStatement "\<symbol-file\>"
51 syn match gdbStatement "\<up-silently\>"
52 syn match gdbStatement "\<while-stepping\>"
54 syn keyword gdbSet annotate architecture args check complaints confirm editing endian
55 syn keyword gdbSet environment gnutarget height history language listsize print prompt
56 syn keyword gdbSet radix remotebaud remotebreak remotecache remotedebug remotedevice remotelogbase
57 syn keyword gdbSet remotelogfile remotetimeout remotewritesize targetdebug variable verbose
58 syn keyword gdbSet watchdog width write
59 syn match gdbSet "\<auto-solib-add\>"
60 syn match gdbSet "\<solib-absolute-prefix\>"
61 syn match gdbSet "\<solib-search-path\>"
62 syn match gdbSet "\<stop-on-solib-events\>"
63 syn match gdbSet "\<symbol-reloading\>"
64 syn match gdbSet "\<input-radix\>"
65 syn match gdbSet "\<demangle-style\>"
66 syn match gdbSet "\<output-radix\>"
68 syn match gdbComment "^\s*#.*"
70 syn match gdbVariable "\$\K\k*"
72 " Strings and constants
73 syn region gdbString start=+"+ skip=+\\\\\|\\"+ end=+"+
74 syn match gdbCharacter "'[^']*'" contains=gdbSpecialChar,gdbSpecialCharError
75 syn match gdbCharacter "'\\''" contains=gdbSpecialChar
76 syn match gdbCharacter "'[^\\]'"
77 syn match gdbNumber "\<[0-9_]\+\>"
78 syn match gdbNumber "\<0x[0-9a-fA-F_]\+\>"
81 if !exists("gdb_minlines")
84 exec "syn sync ccomment gdbComment minlines=" . gdb_minlines
86 " Define the default highlighting.
87 " For version 5.7 and earlier: only when not done already
88 " For version 5.8 and later: only when an item doesn't have highlighting yet
89 if version >= 508 || !exists("did_gdb_syn_inits")
91 let did_gdb_syn_inits = 1
92 command -nargs=+ HiLink hi link <args>
94 command -nargs=+ HiLink hi def link <args>
96 HiLink gdbFuncDef Function
97 HiLink gdbComment Comment
98 HiLink gdbStatement Statement
99 HiLink gdbString String
100 HiLink gdbCharacter Character
101 HiLink gdbVariable Identifier
102 HiLink gdbSet Constant
104 HiLink gdbDocument Special
105 HiLink gdbNumber Number
109 let b:current_syntax = "gdb"