Skip to content

Commit 66da755

Browse files
committed
support commands block in gdb log format #44
1 parent 00b23bf commit 66da755

File tree

3 files changed

+48
-4
lines changed

3 files changed

+48
-4
lines changed

syntaxes/gdb-log.tmLanguage.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"expression": {
1111
"patterns": [
1212
{ "include": "#prompt" },
13+
{ "include": "#carret" },
1314
{ "include": "#frame" },
1415
{ "include": "#at_location" },
1516
{ "include": "#in_function" },
@@ -27,6 +28,16 @@
2728
}
2829
]
2930
},
31+
"carret": {
32+
"patterns": [
33+
{
34+
"name": "carret.gdb",
35+
"begin": "(?:^|\\G)>",
36+
"patterns": [ { "include": "source.gdb" } ],
37+
"end": "$"
38+
}
39+
]
40+
},
3041
"frame": {
3142
"patterns": [
3243
{

syntaxes/gdb.tmLanguage.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,11 @@
13751375
"1": { "name": "keyword.control.command.gdb" },
13761376
"2": { "patterns": [ { "include": "#numeric"} ] }
13771377
}
1378+
},
1379+
{
1380+
"name": "meta.command.silent.gdb",
1381+
"match": "(?:^|\\G)(silent)[ \t]*$",
1382+
"captures": { "1": { "name": "keyword.control.command.gdb" } }
13781383
}
13791384
]
13801385
},
@@ -1387,15 +1392,28 @@
13871392
"1": { "name": "keyword.control.command.gdb" },
13881393
"2": { "name": "entity.name.tag.breakpoint.gdb" }
13891394
},
1390-
"end": "^[ \t]*(end)[ \t]*$",
13911395
"patterns": [
13921396
{
1393-
"match": "^[ \t]*(silent)[ \t]*$",
1394-
"captures": { "1": { "name": "keyword.control.command.gdb" } }
1397+
"begin": "(?:^|\\G)(>)",
1398+
"beginCaptures": { "1": { "name" : "support.class.carret.gdb" }},
1399+
"patterns": [ { "include": "#expression"} ],
1400+
"end": "$"
1401+
},
1402+
{
1403+
"match": "^[ \t]*(Type commands for breakpoint\\(s\\) \\d+, one per line.)$",
1404+
"captures": { "1": { "name": "comment.line.gdb" } }
1405+
},
1406+
{
1407+
"match": "^[ \t]*(End with a line saying just \"end\".)$",
1408+
"captures": { "1": { "name": "comment.line.gdb" } }
13951409
},
13961410
{ "include": "#expression" }
13971411
],
1398-
"endCaptures": { "1": { "name": "keyword.control.end.commands.gdb" } }
1412+
"end": "^[ \t]*(>?)(end)[ \t]*$",
1413+
"endCaptures": {
1414+
"1": { "name": "support.class.carret.gdb" },
1415+
"2": { "name": "keyword.control.end.commands.gdb" }
1416+
}
13991417
},
14001418
{
14011419
"name": "meta.block.conditional.gdb",

tests/scripts/issues/44.gdb-log

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(gdb) continue
2+
Continuing.
3+
^C
4+
Program received signal SIGINT, Interrupt.
5+
0x9affb062b0f7 in testme () from /some/lib.so
6+
(gdb) commands
7+
Type commands for breakpoint(s) 4, one per line.
8+
End with a line saying just "end".
9+
>silent
10+
>break somefunc
11+
>end
12+
(gdb) break test.c:1098
13+
Breakpoint 5 at 0x7fffb062b0f7: file /tmp/test.c, line 1098.
14+
(gdb) c
15+
Continuing.

0 commit comments

Comments
 (0)