microsoft / microsoft/vscode-cpptools
Natvis unable to parse C structs defined like 'struct XXX'
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Consider we have struct (I am talking about C language, not C++):
struct __STKFRM__
{
uint32_t r4, r5, r6, r7, r8, r9, r10, r11;
................
};
Both variants struct __STKFRM__ and __STKFRM__ of Name attribute in natvis Type rule does not produce expected result (it just ignores the rule).
The log contains the following lines:
1: (3662) <-1020-var-create - * "Running->psp"
1: (3688) ->1020^done,name="var1",numchild="16",value="0x2000465c <DisplayTaskStack+860>",type="struct __STKFRM__ *",has_more="0"
1: (3688) ->(gdb)
1: (3688) 1020: elapsed time 26
1: (3691) Natvis failed to parse typename: struct __STKFRM__ *
If I define the struct using typedef everything works.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue concerns Natvis parsing of the Name attribute for C struct types, with the GDB log showing struct __STKFRM__ * rejected. Start by reproducing the shown struct and testing both Name forms against the typedef case; done when tagged C struct names are accepted by Natvis.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100