microsoft / microsoft/vscode-cpptools
Natvis format specifier `,s` doesn't work
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 6.2k
- Forks
- 1.7k
- Ø Merge
- 14 Std. 46 Min.
- Gemergte PRs (30 T.)
- 61
Beschreibung
Issue Type: Bug
Format specifier ,s doesn't work.
How to reproduce
- Compile and debug the following code:
(Mingw gcc 11 is used)
#include <string>
int main()
{
std::string string("test");
return 0;
}
- Use the following natvis entity:
<Type Name="std::string">
<AlternativeType Name="std::__cxx11::basic_string<*>"/>
<DisplayString>{_M_dataplus._M_p,s}</DisplayString>
<Expand>
<Item Name="size">_M_string_length</Item>
<Item Name="capacity" Condition="_M_dataplus._M_p == _M_local_buf">sizeof(_M_local_buf)</Item>
<Item Name="capacity" Condition="_M_dataplus._M_p != _M_local_buf">_M_allocated_capacity</Item>
<Item Name="string">_M_dataplus._M_p,s</Item>
</Expand>
</Type>
- See that
,sformat specifier in<DisplayString>and<Item Name="string">doesn't change anything in debug view, hover and showDisplayString.
Actual result:

Expected result: string = "test" (without leading address)
Extension version: 1.5.0-insiders2
VS Code version: Code 1.57.1 (507ce72a4466fbb27b715c3722558bb15afa9f48, 2021-06-17T13:28:07.755Z)
OS version: Windows_NT x64 10.0.17763
Restricted Mode: No
System Info
| Item | Value |
|---|---|
| CPUs | Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992) |
| GPU Status | 2d_canvas: enabled gpu_compositing: enabled multiple_raster_threads: enabled_on oop_rasterization: enabled opengl: enabled_on rasterization: enabled skia_renderer: enabled_on video_decode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled |
| Load (avg) | undefined |
| Memory (System) | 15.85GB (8.96GB free) |
| Process Argv | --locale=en --crash-reporter-id c8510ba5-736a-4465-9c29-9471122a68c5 |
| Screen Reader | no |
| VM | 0% |
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30311713
vspre833:30321513
pythonptprofiler:30281270
vshan820:30294714
pythondataviewer:30285071
vscus158:30321503
pythonvsuse255cf:30323309
vscorehov:30309549
vscod805cf:30301675
pythonvspyt200:30324779
binariesv615:30325510
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Im Issue ist keine Quelldatei und kein Test genannt. Reproduzieren Sie das Verhalten mit dem bereitgestellten C++-Programm und der Natvis-Entität und verfolgen Sie anschließend die Verarbeitung des Format-Spezifizierers ,s in DisplayString- und Item-Ausdrücken. Als erledigt gilt die Aufgabe, wenn die Debug-Ansicht, der Hover und showDisplayString string = "test" ohne die führende Adresse darstellen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- cpp, typescript
- Bereich
- developer-experience, devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100