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