Skip to content

Commit b33c37b

Browse files
committed
v0.1.1 see changelog
1 parent 63f2c33 commit b33c37b

File tree

5 files changed

+92
-14
lines changed

5 files changed

+92
-14
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ Commits will slow down. May not update at all.
1010

1111
- Other in [GDB commands, variable and function](https://sourceware.org/gdb/current/onlinedocs/gdb/Command-and-Variable-Index.html#Command-and-Variable-Index).
1212

13+
## [0.1.1] 2020-06-17
14+
### Added
15+
* set logging
16+
* set logging file/overwrite
17+
* tbreak
18+
* set pagination
19+
* ignore
20+
1321
## [0.1.0] 2020-06-15
1422
### Added
1523
* Python command block

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ This extension provides a grammar file to parse and color GDB command files.
88

99
![Color highlight](images/basic.png)
1010

11+
Unlike other languague, GDB will accept incomplete word when there's no ambiguity,
12+
so `set loggging overwrite off` is as valid as `set lo ov of`.
13+
14+
That means that you just can't put every keyword in one regexp to render each keyword.
15+
To have a consistant color hilight each command has it's own regexp.
16+
1117
Disclaimer: for the moment, all the commands that I use are rendered.
1218
Commits will slow down. May not update at all.
1319

14-
## [0.1.0] 2020-06-15
20+
## [0.1.1] 2020-06-17
1521
### Added
16-
* Python command block
17-
* set auto-load python-scripts/local-gdbinit/safe-path
18-
* set history save
19-
* .gdbinit extension
22+
* set logging
23+
* set logging file/overwrite
24+
* tbreak
25+
* set pagination
26+
* ignore
2027

2128

2229
## Roadmap

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Syntax color for GDB command",
66
"repository": "https://github.com/pirpyn/gdb-syntax-vscode",
77
"icon" : "images/archer.png",
8-
"version": "0.1.0",
8+
"version": "0.1.1",
99
"engines": {
1010
"vscode": "^1.45.0"
1111
},

syntaxes/gdb.tmLanguage.json

Lines changed: 49 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,18 @@
4242
"2": { "name": "variable.other.arguments.gdb" }
4343
}
4444
},
45+
{
46+
"name": "meta.ignore.gdb",
47+
"match": "^\\s*(ig(?:n(?:o(?:r(?:e)?)?)?)?)\\b\\s+(\\d+|\\$\\w+)\\s+(\\d+)$",
48+
"captures": {
49+
"1": { "name": "keyword.control.command.gdb" },
50+
"2": { "name": "entity.name.tag.breakpoint.gdb" },
51+
"3": { "name": "constant.numeric.count.ignore.gdb" }
52+
}
53+
},
4554
{
4655
"name": "meta.break.gdb",
47-
"match": "^\\s*(b(?:r(?:e(?:a(?:k)?)?)?)?)\\b(?:\\s+([^\\s]+)\\s*(?:\\s+(if)\\s*(.*))?)?\\s*$",
56+
"match": "^\\s*(t?b(?:r(?:e(?:a(?:k)?)?)?)?)\\b(?:\\s+([^\\s]+)\\s*(?:\\s+(if)\\s*(.*))?)?\\s*$",
4857
"captures": {
4958
"1": { "name": "keyword.control.command.gdb" },
5059
"2": { "name": "markup.underline.link.location.gdb" },
@@ -151,7 +160,45 @@
151160
},
152161
{
153162
"name": "meta.set.auto-load.python.gdb",
154-
"match": "^\\s*(set)\\s+(auto-load)\\s+(python-scripts(?:\\s+(?:on|off|.*))?)\\s*$",
163+
"match": "^\\s*(set)\\s+(auto-load)\\s+(python-scripts(?:\\s+(?:on|of(?:f)?|.*))?)\\s*$",
164+
"captures": {
165+
"1": { "name": "keyword.control.command.gdb" },
166+
"2": { "name": "support.function.option.gdb" },
167+
"3": { "name": "variable.other.variable.gdb" }
168+
}
169+
},
170+
{
171+
"name": "meta.set.logging.gdb",
172+
"match": "^\\s*(set)\\s+(lo(?:g(?:g(?:i(?:n(?:g)?)?)?)?)?)(?:\\s+(on|of(?:f)?)(?:\\s+(.*))?)?\\s*$",
173+
"captures": {
174+
"1": { "name": "keyword.control.command.gdb" },
175+
"2": { "name": "support.function.option.gdb" },
176+
"3": { "name": "variable.other.variable.gdb" },
177+
"4": { "name": "markup.underline.link.filename.gdb" }
178+
}
179+
},
180+
{
181+
"name": "meta.set.logging.file.gdb",
182+
"match": "^\\s*(set)\\s+(lo(?:g(?:g(?:i(?:n(?:g)?)?)?)?)?)\\s+(f(?:i(?:l(?:e)?)?)?)\\s+(.*)\\s*$",
183+
"captures": {
184+
"1": { "name": "keyword.control.command.gdb" },
185+
"2": { "name": "support.function.option.gdb" },
186+
"3": { "name": "variable.other.variable.gdb" },
187+
"4": { "name": "markup.underline.link.filename.gdb" }
188+
}
189+
},
190+
{
191+
"name": "meta.set.logging.overwrite.gdb",
192+
"match": "^\\s*(set)\\s+(lo(?:g(?:g(?:i(?:n(?:g)?)?)?)?)?)\\s+(ov(?:e(?:r(?:w(?:r(?:i(?:t(?:e)?)?)?)?)?)?)?(?:\\s+(on|of(?:f)?))?)\\s*$",
193+
"captures": {
194+
"1": { "name": "keyword.control.command.gdb" },
195+
"2": { "name": "support.function.option.gdb" },
196+
"3": { "name": "variable.other.variable.gdb" }
197+
}
198+
},
199+
{
200+
"name": "meta.set.pagination.gdb",
201+
"match": "^\\s*(set)\\s+(pa(?:g(?:i(?:n(?:a(?:t(?:i(?:o(?:n)?)?)?)?)?)?)?)?)(?:\\s+(on|of(?:f)?))?\\s*$",
155202
"captures": {
156203
"1": { "name": "keyword.control.command.gdb" },
157204
"2": { "name": "support.function.option.gdb" },

test.gdb

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
# An exemple of the color higlight ( basic VSCode theme )
22
# All command keyword are purple/pink
3-
# Path usually are underlined
3+
# Path are underlined
44
file path/to/program_to_debug.ext
55
break main.c:123
66
source commands.gdb
7+
set logging on gdb.txt
78
# Command options are yellow, and argument list blue
9+
set logging overwrite on
810
set args arg1 args2
11+
set pagination off
912
# Convenience variable are in a darker blue
1013
set $br_main = $bpnum
1114
# Things related to the system like signals number are green
@@ -17,12 +20,14 @@ command $br_main
1720
end
1821
# At the moment, break on function render the same as for path
1922
# but conditionals are emphasized
20-
break main if (argc > 0)
23+
tbreak main if (argc > 0)
24+
# When command as breakpoint number as arhument, it's rendered in a darker blue
2125
condition 2 (argc > 0)
2226
# watch understand when looking at memory location
2327
watch argc
2428
watch *(int*) 0x12345
25-
29+
# counter render has numeric constant, light green
30+
ignore $bpnum 10
2631
# Python command block uses python textMate Grammar
2732
python
2833
import os
@@ -106,8 +111,6 @@ source -v /path/to/location
106111

107112
if condition
108113

109-
inside if
110-
111114
else
112115
end
113116

@@ -124,4 +127,17 @@ set history save on
124127

125128

126129
# skip function in std namespace
127-
skip -rfu ^std::
130+
skip -rfu ^std::
131+
132+
set logging file /dev/stderr
133+
set logging of
134+
set loggi on filename
135+
set loggi ov of
136+
set lo overwrite on
137+
138+
set pagination off
139+
140+
tbreak file:666
141+
142+
ignore 12 59
143+
ignore $bpnum 10

0 commit comments

Comments
 (0)