microsoft / microsoft/vscode-cpptools
Natvis format specifier `,s` doesn't work
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Nell’issue non sono indicati né un file sorgente né un test. Riproduci il comportamento con il programma C++ e l’entità Natvis forniti, quindi traccia la gestione dello specificatore di formato ,s nelle espressioni DisplayString e Item. Il lavoro è completato quando la vista di debug, l’hover e showDisplayString visualizzano string = "test" senza l’indirizzo iniziale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, typescript
- Ambito
- developer-experience, devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100