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