vadimcn / codelldb

A native debugger extension for VSCode based on LLDB
https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
MIT License
2.43k stars 237 forks source link

Get Syntax error in the watch. #938

Closed mttbx closed 1 year ago

mttbx commented 1 year ago

If I put "x->val" in the watch, I get the error "Syntax error: x->val". This is the code:

#include <memory>
#include <vector>

using namespace std;

struct A {
  vector<int> val;
};

int main() {

  shared_ptr<A> x = make_shared<A>();
  x->val.resize(3, 0);
  return 0; // breakpoint here
}

I can use command to print it. By the way There's some extra new lines in the output, maybe some bugs?

p x->val
(std::vector<int, std::allocator<int> >) $0 = size=3 {
  [0] = 0
  [1] = 0
  [2] = 0
}
v x->val
(std::vector<int, std::allocator<int> >) x->val = size=3 {
  [0] = 0
  [1] = 0
  [2] = 0

}
vadimcn commented 1 year ago

https://github.com/vadimcn/codelldb/blob/1cef1e781e8adc6b071100e4f0342de181e29a4f/MANUAL.md#expressions

mttbx commented 1 year ago

cool!