microsoft / microsoft/MIEngine

Base class members are not displayed correctly using natvis files (LLDB)

Open
#657 14 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
859
Forks
233
Avg merge
1d 6h
Merged PRs (30d)
3

Description

Hi,

Under MacOS with LLDB, natvis fails to resolve base class member expressions, generating an error message instead. For example, given the code:

class ClassA
{
public:
  int intVal;
};

class ClassB : public ClassA
{
public:
};

int main()
{
  ClassB b;
  b.intVal = 42;
}

ClassB will not resolve the member expression intVal when used in a natvis file.

Attached is a small example project highlighting the issue. Note that this project also highlights anonymous structure and union issues with and without natvis under LLDB (see comments at the top of main.cpp for details) reported here.

Windows 10 + CDB (Visual Studio 2017). Works as expected with and without natvis.
Ubuntu 16.04 + GDB 7.11.1. Works without natvis, generates expression errors with.
MacOS 10.12.6 + LLDB 370.0.42 (XCode 8.3.2 installed). Fails with or without natvis.

vscode-natvis.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached vscode-natvis.zip, especially main.cpp and the natvis example, and reproduce the base-class member expression failure under LLDB on macOS. Done means the ClassB natvis expression resolves intVal without an expression error, while preserving the reported behavior on the other debugger configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, macos
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.