[Lldb-commits] [PATCH] D53506: [ClangASTContext] Extract VTable pointers from C++ objects

Aleksandr Urakov via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 22 09:14:27 PDT 2018


aleksandr.urakov created this revision.
aleksandr.urakov added reviewers: clayborg, labath, granata.enrico.
aleksandr.urakov added a project: LLDB.
Herald added subscribers: lldb-commits, teemperor, abidh.

This patch processes the case of retrieving a virtual base when the object is already read from the debuggee memory.

To achieve that `ValueObject::GetCPPVTableAddress` was removed (btw, it really returned not a C++ VTable address but an object's address, which is a C++ VTable **pointer** address for Itanium, but have nothing to do with VTable address for MSVC) and was reimplemented in `ClangASTContext` (because access to the process is needed to retrieve the VTable pointer in general, and because this is the only place that used old version of `ValueObject::GetCPPVTableAddress`).

This patch allows to use real object's VTable instead of searching virtual bases by offsets restored by `MicrosoftRecordLayoutBuilder`. PDB has no enough info to restore VBase offsets properly, so we have to read real VTable instead.

This patch depends on https://reviews.llvm.org/D53497


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D53506

Files:
  include/lldb/Core/ValueObject.h
  lit/SymbolFile/PDB/Inputs/VBases.cpp
  lit/SymbolFile/PDB/Inputs/VBases.script
  lit/SymbolFile/PDB/vbases.test
  source/Core/ValueObject.cpp
  source/Symbol/ClangASTContext.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53506.170430.patch
Type: text/x-patch
Size: 12328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20181022/a32e20a9/attachment-0001.bin>


More information about the lldb-commits mailing list