You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+39-22
Original file line number
Diff line number
Diff line change
@@ -23,8 +23,7 @@ variables.
23
23
24
24
### Show contents of containers
25
25
26
-
Extension support showing contents of containers: `List` (including subtypes)
27
-
and `Bitmapset`.
26
+
Extension support showing contents of containers: `List` (including Oid, TransactionId, int and custom user pointer types) and `Bitmapset`.
28
27
29
28

30
29
@@ -35,13 +34,11 @@ and `Bitmapset`.
35
34
36
35

37
36
38
-
Also, there is support for C-arrays (like `PlannerInfo->simple_rel_array`) -
39
-
array is displayed using it's length.
37
+
Also, there is support for C-arrays (like `PlannerInfo->simple_rel_array`) - array is displayed using it's length.
40
38
41
39

42
40
43
-
Currently, there are 36 registered array members, but you can add your own
44
-
using [pgsql_hacker_helper.json](#pgsql_hacker_helperjson) configuration file.
41
+
Currently, there are 36 registered array members, but you can add your own using [pgsql_hacker_helper.json](#pgsql_hacker_helperjson) configuration file.
45
42
46
43
### Show where Bitmapset references
47
44
@@ -134,7 +131,7 @@ Example json:
134
131
135
132
```json
136
133
{
137
-
"version": 3,
134
+
"version": 4,
138
135
"specialMembers": {
139
136
"array": [
140
137
{
@@ -160,13 +157,30 @@ Example json:
160
157
"type": "PlannerInfo *"
161
158
}
162
159
],
163
-
"typedefs": "my.typedefs.file"
160
+
"typedefs": "my.typedefs.file",
161
+
"customListTypes": [
162
+
{
163
+
"type": "char *",
164
+
"member": ["UserData", "knownNames"]
165
+
},
166
+
{
167
+
"type": "struct FileChunks *",
168
+
"variable": ["ProcessFileChunks", "chunks"]
169
+
}
170
+
]
164
171
}
165
172
```
166
173
167
-
In example 3 array special members - arrays will be shown with specified length,
168
-
not just pointers to arrays start.
169
-
Also, `PlannerRef` - typedef for `PlannerInfo *`.
174
+
Features:
175
+
176
+
- 3 *array* special members (pointer field used as array) - `"typeName"->"memberName"` will be shown with length `"typeName"->"lengthExpression"`, not as simple pointers.
177
+
178
+
-`PlannerRef` - custom user typedef for `PlannerInfo *`.
179
+
180
+
-`UserData->knownNames` is a `List *` that contains pointer elements not `Node *`, but `char *` (`List` of strings).
181
+
Variable `chunks` in function `ProcessFileChunks` is a `List` that contains pointer elements not `Node *`, but `struct FileChunks *`.
182
+
183
+
- User provided custom `typedefs` list (used by formatter).
170
184
171
185
For more info check [configuration file documentation](./docs/config_file.md).
172
186
@@ -218,30 +232,34 @@ Minimal supported version of:
218
232
> It is tested manually and not all use cases might be covered. If you found
219
233
> bug specific to some version please [create issue](https://github.com/ashenBlade/postgres-dev-helper/issues).
220
234
221
-
Also, extension will target latest VS Code version and try to use the full
222
-
functionality of new versions. So, use latest VS Code versions to get new
223
-
features earlier.
235
+
Also, extension will target latest VS Code version and try to use the full functionality of new versions.
236
+
So, use latest VS Code versions to get new features earlier.
224
237
225
238
For using formatter minimal supported version Postgres is `10`.
226
239
240
+
> WARN: I *do not stand* that all extension features will work as expected on all versions
241
+
227
242
## Known Issues
228
243
229
244
Known issues:
230
245
231
-
- If in pointer variable was garbage, extension will not detect it and expand
232
-
this variable (may be garbage).
246
+
- If in pointer variable was garbage, extension will not detect it and expand this variable (may be garbage).
247
+
Usually, this will not lead to fatal errors, just note this.
233
248
- To get NodeTags extension reads all available NodeTag files (from settings),
234
249
but these files may be not created (./configure or make not run). I assume by
235
-
time of debugging start files will be created, so extension catch them and
236
-
process.
237
-
- Tested only with [ms-vscode.cpptools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
238
-
extension. Currently, no support for other DAP adapters (i.e. Code LLDB)
250
+
time of debugging start files will be created, so extension catch them and process.
251
+
- Works only with [ms-vscode.cpptools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)
252
+
extension. Currently, no support for other DAP adapters (i.e. Code LLDB).
253
+
Reason: strongly tied to output format of this extension (not only expression evaluation, but stack trace format i.e.)
239
254
- Sometimes formatting can misbehave. This is due to `pg_bsd_indent` internal
240
255
logic. If formatting is not applied try run command again. If file after
241
256
formatting is a mess this can be due to errors in logic.
242
257
- Some operations require data to be allocated (usually, for function invocation).
243
258
For this, `palloc` and `pfree` are used. So if you are debugging memory subsystem
244
259
you may want to disable extension, because it may affect debugging process.
260
+
- Some operations require for some work to be done with system catalog.
261
+
For example, to get function name using it's Oid. So, system catalog (system cache)
262
+
can be modified during extension work.
245
263
246
264
## Release Notes
247
265
@@ -386,5 +404,4 @@ Call `pprint(Node *)` on selected variable in `Variables` view.
386
404
387
405
## Contributing
388
406
389
-
Go to [Issues](https://github.com/ashenBlade/postgres-dev-helper/issues) if you
390
-
want to say something: bugs, features, etc...
407
+
Go to [Issues](https://github.com/ashenBlade/postgres-dev-helper/issues) if you want to say something: bugs, features, etc...
Copy file name to clipboardexpand all lines: docs/config_file.md
+51-4
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,10 @@ It stored inside `.vscode` folder.
5
5
6
6
## Layout
7
7
8
-
There are 2 versions of config file layout.
9
-
Version is specified using top level `"version"` field.
8
+
There are 4 versions of config file layout.
9
+
Version is specified using `"version"` field.
10
10
11
-
Current version - 3.
11
+
Current version - 4.
12
12
13
13
> This file belongs to latest schema version.
14
14
@@ -156,11 +156,58 @@ Read typedefs file `custom.typedefs.list` in current src path.
156
156
}
157
157
```
158
158
159
-
Read global typedefs file stored in temporary directory
159
+
Read global typedefs file stored in temporary directory.
160
160
161
161
```json
162
162
{
163
163
"version": 3,
164
164
"typedefs": "/tmp/cached.custom.typedefs.list"
165
165
}
166
166
```
167
+
168
+
### Custom `List` types
169
+
170
+
Usually, `List *` contains nodes (inherits from `Node`), but actually it can contain any pointer.
171
+
Extension treats all `List` as they contain `Node` variables, but you can say that this variable or struct member contains custom type (pointer to it).
172
+
173
+
This information stored in `customListTypes` member. This is array of objects:
174
+
175
+
```json
176
+
{
177
+
"version": 4,
178
+
"customListTypes": [
179
+
{
180
+
"type": "MyCustomType *",
181
+
"member": ["ParentStruct", "parent_member"]
182
+
},
183
+
{
184
+
"type": "MyCustomType *",
185
+
"variable": ["ParentFunction", "variable_name"]
186
+
}
187
+
]
188
+
}
189
+
```
190
+
191
+
Each object contain:
192
+
193
+
-`type` - fully-qualified type name (that is `struct` or `pointer` should be included) to which pointer will be casted.
194
+
-`member` - pair of struct name and member of this struct. Definition looks like this:
195
+
196
+
```c
197
+
typedefstruct ParentStruct
198
+
{
199
+
List *parent_member;
200
+
} ParentStruct;
201
+
```
202
+
203
+
-`variable` - pair of function name and variable inside it. Definition looks like this:
204
+
205
+
```c
206
+
void
207
+
ParentFunction()
208
+
{
209
+
List *variable_name;
210
+
}
211
+
```
212
+
213
+
With this 2 strategies extension detects `List`s with custom types.
Copy file name to clipboardexpand all lines: docs/pg_variables.md
+3-2
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,8 @@ Also, there are some Special Node types:
92
92
-`IntList`
93
93
-`OidList`
94
94
-`XidList`
95
+
96
+
Additionally, you can specify custom pointer type in `List`. See [custom `List` types](./config_file.md#custom-list-types) section in configuration file documentation.
95
97
96
98
- Bitmapset - show elements of set in pseudo-member `$elements$`
97
99
@@ -200,9 +202,8 @@ this you should update config file like this:
200
202
}
201
203
```
202
204
203
-
There are about 36 supported asm. For example, `simple_rel_array` for `PlannerInfo`
205
+
There are about 36 supported ASM. For example, `simple_rel_array` for `PlannerInfo`
0 commit comments