Casting variables in watch window

Sysprogs forums Forums VisualGDB Casting variables in watch window

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36363
    Seidleroni
    Participant

    I’ve been using VisualGDB for quite a while and really enjoy it for the most part. I do have one issue and I’m looking to see how I can work around it. My application uses C++ and a lot of variables are pointers to interfaces to classes. Even though the variable is a pointer to an interface of a class, is there a way to *cast* the pointer to the actual class implementation so I can see all the private variables of that class in the watch window?

    #36366
    support
    Keymaster

    Hi,

    The regular C++ cast expressions should work just fine. Either way, VisualGDB passes the watch expressions directly to GDB (you can achieve the same result by running “print <expression>” in the GDB Session window and check the GDB documentation for the supported syntax.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.