hediet / vscode-debug-visualizer

An extension for VS Code that visualizes data during debugging.
https://marketplace.visualstudio.com/items?itemName=hediet.debug-visualizer
GNU General Public License v3.0
7.87k stars 409 forks source link

C/C++ support improvement #108

Open diggit opened 3 years ago

diggit commented 3 years ago

Hi, your extension could really help me in embedded C/C++ development. I thing this extension deserves so much more attention!

I cann use C++ demo here, as it relies on application to provide json data in string.

From the docs and related issues #52 #101 i got the idea, that debug-visualizer needs data as json. I've also seen several mentions of extractors which I guess could help with this conversion. Your last comment in #66 got me confused. Is it even possible to grab some data from debugger, convert them to json a give to visualizer in the first place?

Unfortunately, I am not familiar with how extensions works nor javascript/typescript. I don't even know where to start. Where to put such extractor sources or how to even write one...

Could you please provide some minimal example and instructions?

I just wan to visualize contents of buffer as simple plot.

int main() {
    float counter = 1;

    for (auto& x : buffer) {
        x = counter;
        counter *= -1.05f;
    }
    return 0;
}
hediet commented 3 years ago

Which debugger do you use? Lldb or gdb?

You can extend lldb with custom python scripts. These python scripts could theoretically extract JSON from your c++ buffer, please don't ask me how.

Sadly, I'm neither fluent with c++ nor lldb and am primarily a web developer, so I'm not really motivated to heavily invest into c++ support.

I am open for collaboration though!