2 " Language: Valgrind Memory Debugger Output
3 " Maintainer: Roger Luethi <rl@hellgate.ch>
4 " Program URL: http://devel-home.kde.org/~sewardj/
5 " Last Change: 2002 Apr 07
7 " Notes: mostly based on strace.vim and xml.vim
9 " Quit when a syntax file was already loaded
10 if exists("b:current_syntax")
17 syn match valgrindSpecLine "^[+-]\{2}\d\+[+-]\{2}.*$"
19 syn region valgrindRegion
20 \ start=+^==\z(\d\+\)== \w.*$+
21 \ skip=+^==\z1==\( \| .*\)$+
25 \ contains=valgrindPidChunk,valgrindLine
27 syn region valgrindPidChunk
31 \ contains=valgrindPid0,valgrindPid1,valgrindPid2,valgrindPid3,valgrindPid4,valgrindPid5,valgrindPid6,valgrindPid7,valgrindPid8,valgrindPid9
34 syn match valgrindPid0 "\d\+0=" contained
35 syn match valgrindPid1 "\d\+1=" contained
36 syn match valgrindPid2 "\d\+2=" contained
37 syn match valgrindPid3 "\d\+3=" contained
38 syn match valgrindPid4 "\d\+4=" contained
39 syn match valgrindPid5 "\d\+5=" contained
40 syn match valgrindPid6 "\d\+6=" contained
41 syn match valgrindPid7 "\d\+7=" contained
42 syn match valgrindPid8 "\d\+8=" contained
43 syn match valgrindPid9 "\d\+9=" contained
45 syn region valgrindLine
46 \ start=+\(^==\d\+== \)\@<=+
50 \ contains=valgrindOptions,valgrindMsg,valgrindLoc
52 syn match valgrindOptions "[ ]\{3}-.*$" contained
54 syn match valgrindMsg "\S.*$" contained
55 \ contains=valgrindError,valgrindNote,valgrindSummary
56 syn match valgrindError "\(Invalid\|\d\+ errors\|.* definitely lost\).*$" contained
57 syn match valgrindNote ".*still reachable.*" contained
58 syn match valgrindSummary ".*SUMMARY:" contained
60 syn match valgrindLoc "\s\+\(by\|at\|Address\).*$" contained
61 \ contains=valgrindAt,valgrindAddr,valgrindFunc,valgrindBin,valgrindSrc
62 syn match valgrindAt "at\s\@=" contained
63 syn match valgrindAddr "\(\W\)\@<=0x\x\+" contained
64 syn match valgrindFunc "\(: \)\@<=\w\+" contained
65 syn match valgrindBin "\((\(with\|\)in \)\@<=\S\+\()\)\@=" contained
66 syn match valgrindSrc "\((\)\@<=.*:\d\+\()\)\@=" contained
68 " Define the default highlighting
70 hi def link valgrindSpecLine Type
71 "hi def link valgrindRegion Special
73 hi def link valgrindPid0 Special
74 hi def link valgrindPid1 Comment
75 hi def link valgrindPid2 Type
76 hi def link valgrindPid3 Constant
77 hi def link valgrindPid4 Number
78 hi def link valgrindPid5 Identifier
79 hi def link valgrindPid6 Statement
80 hi def link valgrindPid7 Error
81 hi def link valgrindPid8 LineNr
82 hi def link valgrindPid9 Normal
83 "hi def link valgrindLine Special
85 hi def link valgrindOptions Type
86 "hi def link valgrindMsg Special
87 "hi def link valgrindLoc Special
89 hi def link valgrindError Special
90 hi def link valgrindNote Comment
91 hi def link valgrindSummary Type
93 hi def link valgrindAt Special
94 hi def link valgrindAddr Number
95 hi def link valgrindFunc Type
96 hi def link valgrindBin Comment
97 hi def link valgrindSrc Statement
99 let b:current_syntax = "valgrind"