Commit bb02552
authored
Don't expose a memory reference for non-pointer evaluation results (#1601)
Gate the memoryReference on pointer and array types in OpenDebugAD7
A non-pointer scalar shown in a data tip or the Variables view carried a
memoryReference, so VS Code rendered the "view binary data" icon and
navigated to an address equal to the value (hovering a uint32_t of 1
opened a memory view at 0x1).
The earlier approach gated AD7Property.GetMemoryContext in the engine, but
that method is shared with Visual Studio, where the Memory and Disassembly
windows resolve a typed address expression through it. Restricting it
there breaks entering a scalar or address expression into those windows.
Move the restriction to the DAP layer: in
AD7Utils.GetMemoryReferenceFromIDebugProperty, emit a memoryReference only
when the property type is a pointer or an array. GetMemoryContext is left
unchanged, so the Visual Studio memory and disassembly navigation keep
working, while VS Code no longer offers a memory view for scalars. VS Code
has no free-form address entry, so gating the reference removes no entry
point there.1 parent a5d90d8 commit bb02552
1 file changed
Lines changed: 42 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
24 | 40 | | |
25 | 41 | | |
26 | 42 | | |
| |||
34 | 50 | | |
35 | 51 | | |
36 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
37 | 77 | | |
38 | 78 | | |
0 commit comments