CarlosAlbertoEnciso wrote:

@clayborg Thanks very much for the extra information.

> FYI: There is already VTable support in our lldb::SBValue class and it is 
> part of the public API in LLDB and doesn't require any of this:
> 
> ```
> $ cat main.cpp
>    1          #include <stdio.h>
>    2          
>    3          class Foo {
>    4          public:
>    5            virtual ~Foo() = default;
>    6            virtual void Dump() {
>    7              puts(__PRETTY_FUNCTION__);
>    8            }
>    9          };
>    10         
>    11         int main(int argc, const char **argv) {
>    12           Foo f;
>    13           f.Dump();
>    14           return 0;
>    15         }
> ```
> 
> Then when you debug:
> 
> ```
> (lldb) script
> Python Interactive Interpreter. To exit, type 'quit()', 'exit()' or Ctrl-D.
> >>> v = lldb.frame.FindVariable('f')
> >>> v.GetVTable()
> vtable for Foo = 0x0000000100004030 {
>   [0] = 0x0000000100003ea4 a.out`Foo::~Foo() at main.cpp:5
>   [1] = 0x0000000100003ef4 a.out`Foo::~Foo() at main.cpp:5
>   [2] = 0x0000000100003e7c a.out`Foo::Dump() at main.cpp:6
> }
> ```
> 
> Doesn't require any debug info.

Just a question: Can that functionality be used before the object is 
constructed?

https://github.com/llvm/llvm-project/pull/130255
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to