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 | |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 7 | " quit when a syntax file was already loaded |
| 8 | if exists("b:current_syntax") |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 9 | finish |
| 10 | endif |
| 11 | |
Bram Moolenaar | 0c5fa7d | 2012-10-05 22:26:30 +0200 | [diff] [blame] | 12 | let s:cpo_save = &cpo |
| 13 | set cpo&vim |
| 14 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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" |
| 21 | |
| 22 | |
| 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 |
| 34 | |
Bram Moolenaar | 0c5fa7d | 2012-10-05 22:26:30 +0200 | [diff] [blame] | 35 | " some commonly used abbreviations |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 36 | syn keyword gdbStatement c disp undisp disas p |
| 37 | |
Bram Moolenaar | 5c73622 | 2010-01-06 20:54:52 +0100 | [diff] [blame] | 38 | syn region gdbDocument matchgroup=gdbFuncDef start="\<document\>.*$" matchgroup=gdbFuncDef end="^end\s*$" |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 39 | |
| 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\>" |
| 53 | |
| 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\>" |
| 67 | |
Bram Moolenaar | 0c5fa7d | 2012-10-05 22:26:30 +0200 | [diff] [blame] | 68 | syn match gdbComment "^\s*#.*" contains=@Spell |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 69 | |
| 70 | syn match gdbVariable "\$\K\k*" |
| 71 | |
| 72 | " Strings and constants |
Bram Moolenaar | 0c5fa7d | 2012-10-05 22:26:30 +0200 | [diff] [blame] | 73 | syn region gdbString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@Spell |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 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_]\+\>" |
| 79 | |
| 80 | |
| 81 | if !exists("gdb_minlines") |
| 82 | let gdb_minlines = 10 |
| 83 | endif |
| 84 | exec "syn sync ccomment gdbComment minlines=" . gdb_minlines |
| 85 | |
| 86 | " Define the default highlighting. |
Bram Moolenaar | 89bcfda | 2016-08-30 23:26:57 +0200 | [diff] [blame] | 87 | " Only when an item doesn't have highlighting yet |
| 88 | command -nargs=+ HiLink hi def link <args> |
| 89 | HiLink gdbFuncDef Function |
| 90 | HiLink gdbComment Comment |
| 91 | HiLink gdbStatement Statement |
| 92 | HiLink gdbString String |
| 93 | HiLink gdbCharacter Character |
| 94 | HiLink gdbVariable Identifier |
| 95 | HiLink gdbSet Constant |
| 96 | HiLink gdbInfo Type |
| 97 | HiLink gdbDocument Special |
| 98 | HiLink gdbNumber Number |
| 99 | delcommand HiLink |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 100 | |
| 101 | let b:current_syntax = "gdb" |
| 102 | |
Bram Moolenaar | 0c5fa7d | 2012-10-05 22:26:30 +0200 | [diff] [blame] | 103 | let &cpo = s:cpo_save |
| 104 | unlet s:cpo_save |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 105 | " vim: ts=8 |